Open
Conversation
…/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
imr555
reviewed
Mar 26, 2019
| 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" |
There was a problem hiding this comment.
adding .splitlines() instead of .split('\n') would be more robust
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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