Skip to content

Commit

Permalink
Merge branch 'ball-202' into video-backend
Browse files Browse the repository at this point in the history
  • Loading branch information
kchiem12 committed Dec 3, 2023
2 parents fca1758 + a8bd7e8 commit c195a89
Show file tree
Hide file tree
Showing 39 changed files with 1,054 additions and 12,397 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ jobs:
run: echo $DATA >> ${{github.workspace}}/.env
- name: Run CI tests
run: |
python src/main.py
if [ ! -f ${{github.workspace}}/tmp/court_video_reenc.mp4 ]; then
python src/main.py --skip_court --video_file data/short_new_2.mov
if [ ! -f ${{github.workspace}}/tmp/processed.mp4 ]; then
echo "model run failed: output does not exist"
exit 1
fi
Expand Down
14 changes: 13 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
venv
.env
__pycache__
*__pycache__*
yolov8m-pose.pt
*.mp4
tmp/
.DS_Store
.vscode/
.DS_Store
testing.jpg

# Ignore specific large files
yolov8m-pose.pt
*.mp4 # ignores all .mp4 files; remove this line if some .mp4 files should be tracked
ball/lib/python3.11/site-packages/torch/lib/libtorch_cpu.dylib
venv/lib/python3.11/site-packages/torch/lib/libtorch_cpu.dylib
ball/
tmp/
data/vid1_raw.MOV

# Ignore all .json files in tmp/ directory; adjust as per requirement
tmp/*.json
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ Building a service for the community at large + low budget sports programs for S
│ ├── modelrunner.py # runs all models
│ ├── processrunner.py # runs all processing
│ └── state.py # data structure for everything
├── static # store images for repo
├── test # unit tests
└── tmp # stores generated files
```
Expand Down Expand Up @@ -56,4 +55,4 @@ streamlit run src/view/app.py
```

## Pipeline Diagram
![hooptracker pipeline diagram](static/diagram.png)
![hooptracker pipeline diagram](data/diagram.png)
Binary file added best.pt
Binary file not shown.
59 changes: 57 additions & 2 deletions config.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,57 @@
model_vars:
frame_reduction_factor: 2
default_config : "config.yaml" # path to default config file

# Model parameters
frame_reduction_factor: 2 # cuts on number of frames by this factor
player_weights: 'src/strongsort/weights/best.pt' # path to player and rim weights for yolov5 + stronsort
ball_weights: 'src/strongsort/weights/best_basketball.pt' # path to ball weights for yolov5 + stronsort
pose_weights: 'src/pose_estimation/best.pt' # path to pose estimation weights for yolov8-pose
player_thres:
conf_thres: 0.25 # bbox below threshold are ignored
iou_thres: 0.25 # bboxes that overlap more than this are ignored
pose_thres:
conf: 0.3
skip_big: true # if true, skips big objects for ball detection
cls: # obj type as detected by strongsort
ball: 0
player: 1
rim: 2
save_vid: false # save output of models
show_vid:
player: false
ball: false
pose: false
model_videos: # path to saved videos
player: ''
ball: ''
pose: ''
verbose: false # if true, prints model output to console

# Backend pipeline parameters
skip_model: false # if true, skips model running
skip_process: false # if true, skips processing
skip_court: false # if true, skips court detection
skip_video: false # if true, skips video processing
skip_player_filter: false # if true, allows all tracked ids to be accounted

# Processing parameters
filter_threshold: 10 # min frames for player to be considered in possession
join_threshold: 20 # max frames for same player to still be in possession
shot_window: 10 # window of frames to look at ball intersecting top box and rim box

# Pose action parameters
shot_threshold: 0.8 # threshold for shot action
angle_threshold: 160

# User Input
video_file: 'data/short_new_2.mov' # file to be processed

# File name parameter for output
output: 'tmp' # output folder for model/processing esults and processed videos
basename: '' # base name of output files
people_file: 'tmp/people.txt' # file name of strongsort output for players and rim
ball_file: 'tmp/ball.txt' # file name of strongsort output for ball
pose_file: 'tmp/pose.txt' # file name of pose output for ball
minimap_file: 'tmp/minimap.mp4' # file name of minimap video
minimap_temp_file: 'tmp/minimap_temp.mp4' # file name of minimap video
processed_file: 'tmp/processed.mp4' # file name of processed video
results_file: 'tmp/results.txt' # file name of results file
File renamed without changes
Binary file added data/medium_new_2.mov
Binary file not shown.
Loading

0 comments on commit c195a89

Please sign in to comment.