Skip to content

Commit

Permalink
Update README.md (#136)
Browse files Browse the repository at this point in the history
Update README with example from :

https://sportslabkit.readthedocs.io/en/latest/notebooks/01_get_started/introduction_to_sportslabkit.html

On example in current README the following error is thrown:

AttributeError: module 'sportslabkit' has no attribute 'mot'
  • Loading branch information
LintonAchmad authored Dec 19, 2023
1 parent 26db3d1 commit 4b85b8b
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,20 @@ To get started with tracking your first game, follow this simple example:
```python
import sportslabkit as slk

from sportslabkit.mot import SORTTracker

# Initialize your camera and models
cam = slk.Camera(path_to_mp4)
det_model = slk.detection_model.load('YOLOv8x')
motion_model = slk.motion_model.load('KalmanFilter')
det_model = slk.detection_model.load('YOLOv8x', imgsz=640)
motion_model = slk.motion_model.load('KalmanFilter', dt=1/30, process_noise=10000, measurement_noise=10)

# Configure and execute the tracker
tracker = slk.mot.SORTTracker(detection_model=det_model, motion_model=motion_model)
bbdf = tracker.track(cam)
tracker = SORTTracker(detection_model=det_model, motion_model=motion_model)
tracker.track(cam[:100])
res = tracker.to_bbdf()

save_path = "assets/tracking_results.mp4"
res.visualize_frames(cam.video_path, save_path)

# The tracking data is now ready for analysis
```
Expand Down

0 comments on commit 4b85b8b

Please sign in to comment.