Views
No views yet


1import torch
2
3# Load the model
4model = torch.hub.load_state_dict_from_url(
5 'https://huggingface.co/Ecoaetix/DroneStalker-LSTM-0.3/resolve/main/drone_stalker-0.3.pth'
6)
7
8# Or download and load manually
9from huggingface_hub import hf_hub_download
10
11model_path = hf_hub_download(
12 repo_id="Ecoaetix/DroneStalker-LSTM-0.3",
13 filename="drone_stalker-0.3.pth"
14)
15
16# You'll need the Model class (included as model.py in this repo)
17from model import Model
18
19model = Model(Np=12, Nf=12, hidden_dim=16, num_layers=1, dropout=0)
20model.load_state_dict(torch.load(model_path))
21model.eval()
22
23# Inference
24with torch.no_grad():
25 # Input: [batch_size, 12, 4] - 12 past bounding boxes [x1, y1, x2, y2]
26 predictions = model(past_bboxes)
27 # Output: [batch_size, 12, 4] - 12 future bounding boxes (min-max normalized)[batch_size, 12, 4][x1, y1, x2, y2] where (x1,y1) is top-left, (x2,y2) is bottom-right[batch_size, 12, 4][x1_norm, y1_norm, x2_norm, y2_norm] where values are in range [0, 1]1@misc{DroneStalker-LSTM-0.3,
2 author = {Jacob Kenney},
3 title = {DroneStalker-LSTM-0.3},
4 year = {2025},
5 publisher = {HuggingFace},
6 howpublished = {\url{https://huggingface.co/Ecoaetix/DroneStalker-LSTM-0.3}}
7}