This repository basically analysis tennis video and segment it. Mian objective of this project is user will upload a video via frontend, Backend receive this video and segment and generate new segment videos based on player ball serve.
Importent first install 'ffmpeg', for linux: sudo apt install ffmpeg
- create python virtual env. User python version 3.10
python -m venv venv
- Activate venv [use os based command]
source venv/bin/active
[Linux]
- Install packages
pip install -r requirements.txt
- if 'package 'lap' not found' [Optional]
pip install lap
- Run project
python main.py
- Default url:
localhost:8000 or 0.0.0.0:8000
Create a '.env' file in project root dir. then add below variables with valid values.
AWS_ACCESS_KEY_ID=your_aws_access_key
AWS_SECRET_ACCESS_KEY=your_aws_access_kay
AWS_REGION=which_region your bucket located
IS_UPLOAD_TO_S3=true | false
IS_CLEAN_LOCAL_VIDEOS=false | true
AWS_S3_BUCKET_INPUT=your_bucket_name
AWS_S3_BUCKET_OUTPUT=your_bucket_name
IS_UPLOAD_TO_S3 - - true: cut clip would be uploaded in s3
IS_CLEAN_LOCAL_VIDEOS: - true: local saved clip will be removed.
project_root:
static:
- uploads
- thumbnails
This uploads file contain locally saved clip. I you set IS_CLEAN_LOCAL_VIDEOS = true, it will clean this folder otherwise it will keep.
Download model from given link in release note and keep on bellow folders.
project_root:
- models