Prepare environment (linux)
# Run script
bash start.sh
# activate virtual environment
source dataPrep/bin/activate
Prepare environment (windows)
python3 video2frame.py -v PATHOFVIDEO -i 5 -c STARTINGIMAGENUMBER -f FRAMERATE
Must have Flags:
- video = video path
Optional Flags:
- frames = frame rate of video. Default value is set to 30.
- interval = Time (in seconds) to capture frame. Default value is set to 1 second
- counter = image number after unique id, default is set to 1.
eg: User want to extract image every 5 second from a 30 fps video on path ../data/dashcam.MP4
python3 video2frame.py -v ../data/dashcam.MP4 -i 5 -f 30
Video to images extraction using Yolov4-tiny pretrained model
You can use colab notebook here. Please make a copy before you run the codes on colab.
python3 convert_png2jpg.py --image test.png
python3 rename.py --dir images
dir = path of directory for captured photos
python3 imgAug.py --dir trial --dest result -R -B --bright 2.0 -F
dir = path of data directory to perform augmentation
dest = path of directory to store result
bright = value of brightness
noise = value of noise
degree = degree of rotation
N = use noise augmentation
R = use rotation augmentation
B = use brighness or darkness augmentation
F = use flip augmentation
Please refer to the code for further explaination
python3 remove_jpg.py --dir PATH_TO_DIRECTORY
dir = path to folder
python train_test_valid.py --dir experiments --train_out train --test_out test --valid_out valid
dir = directory of database
train_out = path of train dataset output
test_out = path of ts