Developed by Lingran Zhao and Ziyou Ren
Our code is built on the Detic model. The implementation of bat orientation estimation can be divided into two steps:
- Locate the keyframe using Dino features
- Estimate the angle from the located keyframe using Detic
See installation instructions.
An example video dataset would looks like this:
Automatic-Swing-Angle/
└── videos-pirates
└── demo_videos
├── 00F01C88-4AF3-4679-A7FC-0F41E060C061.mp4
├── 01F8CA5C-16A9-4959-A8D3-E849F7244077.mp4
├── 02853FB8-DCBA-4260-A237-ECA3C3C7C040.mp4
......
└── amateur_demos
├── 1AF5E0A4-379C-4DD8-806A-1033903CF9C3.mp4
├── 2D1A7762-B1BB-493C-B86E-110096173EAE.mp4
├── 26EB9880-22F1-4B70-8BAB-10CB7FA63307.mp4
......
Then, we can run our code with the command python evaluate.py --vid_source_root ./videos-pirates/amateur_demos
. By default, the prediction results will be saved to BatEstimation_v2.csv
.
Note: The algorithm will mark the Angle_Conf as -1 and Angle_Confidence as 0 when there aren't any detection results on the predicted keyframe. (That said, we only provide results on videos where keyframes have a clear bat detection, ensuring higher precision on the positive samples)
Run our demo using Colab (no GPU needed):
The visualization of estimated bat angle :