Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add functionality to build yolov5 yaml #260

Merged
merged 5 commits into from
Jul 13, 2023
Merged

Add functionality to build yolov5 yaml #260

merged 5 commits into from
Jul 13, 2023

Conversation

dsikka
Copy link
Contributor

@dsikka dsikka commented Jul 11, 2023

Summary:

  • Provide the functionality to build a yolov5 yaml file, given the user provides an input directory to the data arg.
  • The following assumptions were made about the directory structure and a sample directory structure is shown below

Assumptions:

  • The directory passed in contains an images subdirectory, a labels subdirectory, and a file called classes.txt which contains the classes, ordered by class id
  • Each of the images and labels subdirectories contains training, testing and validation folders
  • The labels should already be in the format expected by yolov5
  • yolov5 assumes the train, test and validation directories have identical names in both the images and labels folders

Sample Directory Structure:

- data_for_training/
    - labels/
        - train/
        - val/
        - test/
    - images/
        - train/
        - val/
        - test/
    - classes.txt

Example Inputs/Outputs:

Input directory structure:

dsikka@quad-mle-2:~/some_dir/some_dataset$ ls
classes.txt  images

classes.txt:

dog
cat 
house 
park

images dir:

dsikka@quad-mle-2:~/some_dir/some_dataset/images$ ls
test  train  val

yaml file produced:

path: some_dataset/
train:
- images/train
test:
- images/test
val:
- images/val
names:
  0: dog
  1: cat
  2: house
  3: park

Testing:

  • Locally tested training_aware runs by passing in a local directory to the data arg. yaml file produced is correct and training runs to completion

@dsikka dsikka marked this pull request as ready for review July 12, 2023 13:44
Copy link
Member

@rahul-tuli rahul-tuli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Loogs good pending comments!

src/sparsify/auto/tasks/object_detection/yolov5/runner.py Outdated Show resolved Hide resolved
src/sparsify/auto/tasks/object_detection/yolov5/runner.py Outdated Show resolved Hide resolved
src/sparsify/auto/tasks/object_detection/yolov5/runner.py Outdated Show resolved Hide resolved
src/sparsify/auto/tasks/object_detection/yolov5/runner.py Outdated Show resolved Hide resolved
src/sparsify/auto/tasks/object_detection/yolov5/runner.py Outdated Show resolved Hide resolved
src/sparsify/auto/tasks/object_detection/yolov5/runner.py Outdated Show resolved Hide resolved
src/sparsify/auto/tasks/object_detection/yolov5/runner.py Outdated Show resolved Hide resolved
src/sparsify/auto/tasks/object_detection/yolov5/runner.py Outdated Show resolved Hide resolved
Copy link
Member

@bfineran bfineran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM pending rahul's comments

src/sparsify/auto/tasks/object_detection/yolov5/runner.py Outdated Show resolved Hide resolved
@dsikka
Copy link
Contributor Author

dsikka commented Jul 13, 2023

Updated and retested.

@dsikka dsikka merged commit bcd736e into main Jul 13, 2023
3 checks passed
@dsikka dsikka deleted the build_yolo_yaml branch July 13, 2023 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants