https://github.com/mareksubocz/tracknet
:flashlight: Pytorch implementation of TrackNet
https://github.com/mareksubocz/tracknet
apple-silicon-support deep-learning machine-learning ml pytorch single-object-tracking sot tensorboard tracking tracknet wandb
Last synced: 3 months ago
JSON representation
:flashlight: Pytorch implementation of TrackNet
- Host: GitHub
- URL: https://github.com/mareksubocz/tracknet
- Owner: mareksubocz
- License: mit
- Archived: true
- Created: 2022-11-04T12:15:16.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-03-27T22:03:50.000Z (over 2 years ago)
- Last Synced: 2025-06-13T12:07:46.925Z (4 months ago)
- Topics: apple-silicon-support, deep-learning, machine-learning, ml, pytorch, single-object-tracking, sot, tensorboard, tracking, tracknet, wandb
- Language: Python
- Homepage:
- Size: 104 MB
- Stars: 28
- Watchers: 3
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TrackNet
Pytorch implementation based on [TrackNetv2](https://nol.cs.nctu.edu.tw:234/open-source/TrackNetv2).
Supported logging options:## Installation
```
git clone https://github.com/mareksubocz/TrackNet
cd /TrackNet
pip install -r requirements.txt
```## Training
```
python train.py --dataset PATH_TO_DATASET --device cuda
```## Prediction
```
python predict.py PATH_TO_VIDEO --weights PATH_TO_TRAINED_WEIGHTS --device cuda
```## Dataset Labelling
Keybindings:
- l / → : next frame
- h / ← : previous frame
- v : annotate well-visible ball
- o : annotate occluded ball
- m : annotate ball in motion (blurred)
- f : fast-forward/pause video
- n : go to next annotated frame
- x : remove annotation
- = / + : enlarge the annotation mark size
- - : reduce the annotation mark size
- q : finish annotating and save results```
python labellingTool.py video.mp4
```
![]()
Labelling tool in use. Fast-forward function is distorted due to gif compression.## train.py Parameters cheatsheet
| Argument name | Type | Default value | Description |
|--------------------|-------|---------------|-------------|
|weights |str |None |Path to initial weights the model should be loaded with. If not specified, the model will be initialized with random weights.|
|checkpoint |str |None |Path to a checkpoint, chekpoint differs from weights by to including information about current loss, epoch and optimizer state.|
|batch_size |int |2 |Batch size of the training dataset.|
|val_batch_size |int |1 |Batch size of the validation dataset.|
|shuffle |bool |True |Should the dataset be shuffled before training?|
|epochs |int |10 |Number of epochs.|
|train_size |float |0.8 |Training dataset size.|
|lr |float |0.01 |Learning rate.|
|momentum |float |0.9 |Momentum.|
|dropout |float |0.0 |Dropout rate. If equals to 0.0, no dropout is used.|
|dataset |str |'dataset/' |Path to dataset.|
|device |str |'cpu' |Device to use (cpu, cuda, mps).|
|type |str |'auto' |Type of dataset to create (auto, image, video). If auto, the dataset type will be inferred from the dataset directory, defaulting to image.|
|save_period |int |10 |Save checkpoint every x epochs (disabled if <1).|
|save_weights_only |bool |False |Save only weights, not the whole checkpoint|
|save_path |str |'weights/' |Path to save checkpoints at.|
|no_shuffle | - | - |Don't shuffle the training dataset.|
|tensorboard | - | - |Use tensorboard to log training progress.')|
|one_output_frame | - | - |Demand only one output frame instead of three.')|
|no_save_output_examples| - | - |Don't save output examples to results folder.|
|grayscale | - | - |Use grayscale images instead of RGB.')|
|single_batch_overfit | - | - |Overfit the model on a single batch.')|Arguments without type or default value are used without an additional value, e.x.
``` bash
python train.py --dataset dataset/ --grayscale --one_output_frame
```