Skip to content

CertifaiAI/dataset-preparation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tools for data preparations

License Quality Gate Bugs Count Code Smell

Prepare environment (linux)

# Run script
bash start.sh

# activate virtual environment
source dataPrep/bin/activate

Prepare environment (windows)

Video to images extraction

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.

Convert PNG to JPG or JPEG

python3 convert_png2jpg.py --image test.png 

Rename images with random ID

python3 rename.py --dir images

dir = path of directory for captured photos

Data Augmentation

 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

Remove '_jpg', '_JPG', '_jpeg' from filenames

python3 remove_jpg.py --dir PATH_TO_DIRECTORY

dir = path to folder

Train, Test, Split scripts for object detections

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published