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

Some enhancements #52

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Some enhancements #52

wants to merge 9 commits into from

Conversation

gumdal
Copy link

@gumdal gumdal commented Dec 5, 2018

Some enhancements which we needed to get the bounding boxes for Darkent Yolo. I do not quite remember everything which is coded, however, just creating a pull request to see if the author can test and approve this if needed! Enhancements:

ProcessImages.workflow is an automator script to do the following in order: - 1. Get the images to work on - 2. Change the type of the images to JPEG format - 3. Change extension of all files to .JPEG (some files will have .jpg and .JPG etc.) because the BBox tool will accept only *.JPEG extension files. - 4. Scale all the images to 320 px in largest side so that Bbox tool will have a neat image to work on and it will be easy for ML training as well.

process.py file is from https://timebutt.github.io/static/how-to-train-yolov2-to-detect-custom-objects/. This file randomly categorizes an image into training or test data based on the percentage configured in the script for testing. The output of this is fed into darknet for training purpose

check.py - Jinesh authored this initially. check.py file is needed to see if every image file is properly associated with a text annotation file. The script finally copies only those image files for which it has a corresponding text annotation. Multiple annotation in a single image file and the corresponding image files are moved into a separate folder to keep it clean.

Added convert.py from https://github.com/Guanghan/darknet/blob/master/scripts/convert.py with modifications within it. The basic purpose of this script is to convert the BBox label annotation into Yolo format

…/scripts/convert.py with modifications within it. The basic purpose of this script is to convert the BBox label annotation into Yolo format
…ry image file is properly associated with a text annotation file. The script finally copies only those image files for which it has a corresponding text annotation. Multiple annotation in a single image file and the corresponding image files are moved into a separate folder to keep it clean.
…n-yolov2-to-detect-custom-objects/. This file randomly categorizes an image into training or test data based on the percentage configured in the script for testing. The output of this is fed into darknet for training purpose
…order:

1. Get the images to work on
2. Change the type of the images to JPEG format
3. Change extension of all files to .JPEG (some files will have .jpg and .JPG etc.) because the BBox tool will accept only *.JPEG extension files.
4. Scale all the images to 320 px in largest side so that Bbox tool will have a neat image to work on and it will be easy for ML training as well.
Updated the readme with additional information on the automator, process.py, check.py and convert.py scripts.
…les in a folder to the desired index from corresponding *.names file which will be consequently fed in for training
txt_path = mypath + txt_name
print("Input:" + txt_path)
txt_file = open(txt_path, "r")
lines = txt_file.read().split('\n') #for ubuntu, use "\r\n" instead of "\n"
Copy link

Choose a reason for hiding this comment

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

adding .splitlines() instead of .split('\n') would be more robust

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.

2 participants