Downloads · 30 days
0
nutchayaporn/wifi-csi-har-lstm
wifi-csi-har-lstm is a machine learning model from nutchayaporn. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Ready-to-use PyTorch LSTM model for WiFi CSI Human Activity Recognition.
Downloads · 30 days
0
Access
Public
Updated May 8, 2026
Repo size
5.1 MB
Likes
0
Public
Click a slice to open those files.
.pth5.1 MB · 100%
From the Hugging Face model README
Ready-to-use PyTorch LSTM model for WiFi CSI Human Activity Recognition.
wifi-csi-har-lstm/
|-- inference.py
|-- labels.json
|-- model_config.json
|-- requirements.txt
|-- simple_lstm_best.pth
`-- upload_to_hf.py
simple_lstm_best.pthhidden2label classifier(batch, 1024, 468)(1024, 468)standingwalkingget_downsittingget_uplyingno_personInstall dependencies:
pip install -r requirements.txt
Use the cached predictor in backend code so the model is loaded only once:
from inference import get_predictor
predictor = get_predictor()
def classify_csi(csi_array):
# csi_array can be a Python list, NumPy array, or torch.Tensor.
# Accepted shapes: (1024, 468) or (batch, 1024, 468).
return predictor.predict(csi_array)
Example response:
{
"predictions": [
{
"class_index": 0,
"label": "standing",
"confidence": 0.98,
"probabilities": {
"standing": 0.98,
"walking": 0.01,
"get_down": 0.0,
"sitting": 0.0,
"get_up": 0.0,
"lying": 0.0,
"no_person": 0.01
}
}
]
}
from fastapi import FastAPI
from pydantic import BaseModel
from inference import get_predictor
app = FastAPI()
predictor = get_predictor()
class PredictRequest(BaseModel):
csi: list
@app.post("/predict")
def predict(request: PredictRequest):
return predictor.predict(request.csi)
Run with a zero-filled sample to verify the model can load:
python inference.py
Run with JSON input:
python inference.py --input_json sample.json