tutorial-image-and-multiple-bounding-boxes-augmentation-for-deep-learning-in-4-steps's People
Forkers
ngcammayo sadiaafrinpurba welldl quietwoods wanderer2014 casey-alcantar ruchi651 sparkingdark syed-cbot abhipray04 kevinn1999 mariomerida88 fouren714 the-magicians-code 4nd1puj0 karanparekh11tutorial-image-and-multiple-bounding-boxes-augmentation-for-deep-learning-in-4-steps's Issues
Need to make more augmentations
Hello when I run the script once despite the fact that I have delete the restriction of doing only 2 random augmentation one the dataset and the bounding boxes when I use the image_aug
function only 100 images are saved which are the ones that the dataset has. How can I make the 100 augmented images 200 or even 300. Also when I use the image_aug
for my df I use the labels_df
becasue my images don't need to be resized don't know if that little thing is the problem.
Thanks in advance for your help
Conflict when using multiple classes in any image
I'm putting this here mostly so people can avoid this difficult to spot issue in the future.
When using this method of augmenting a dataset where images in the dataset can contain bounding boxes of different classes, it is possible that the classes in the resulting dataframe will be invalid. This is caused by the augmentation process when removing bboxes using .remove_out_of_image()
. Since there is no link between the rows in the main dataframe and bbs_aug, using remove_out_of_image()
can delete a bounding box from bbs_aug however it does not update the rows in the main dataframe to reflect this change. Thus when you bring the newly augmented bboxes back into the main dataframe, some of the rows may be shifted up but only for the positional values of the bboxes and not for any of the remaining columns of the dataframe.
To fix this, you need to somehow link the dataframe and the bbox augmentation arrays and remove any rows in the dataframe that contain bounding boxes that are removed using remove_out_of_image()
.
CSV file to XML
Hello, How can the content of the csv file be converted back to separate xml files including the augmented bboxes?
bbs_a AssertionError in [25]
Hello,
I experience an issue when running the almost last code in [25]
of your notebook. I could not fix it yet. Still, very impressive Augmentation Code!
AssertionError Traceback (most recent call last)
<ipython-input-29-32529b912587> in <module>()
16 bb_a_array = group_a_df.drop(['filename', 'width', 'height', 'class'], axis=1).values
17 augmented_img = imageio.imread('aug_dataset/'+'aug1_'+filename)
---> 18 bbs_a = BoundingBoxesOnImage.from_xyxy_array(bb_a_array, shape=augmented_img.shape)
19
20 ia.imshow(np.hstack([
3 frames
/usr/local/lib/python3.6/dist-packages/imgaug/augmentables/bbs.py in from_xyxy_array(cls, xyxy, shape)
923 ia.do_assert(xyxy.shape[1] == 4, "Expected input array of shape (N, 4), got shape %s." % (xyxy.shape,))
924
--> 925 boxes = [BoundingBox(*row) for row in xyxy]
926
927 return cls(boxes, shape)
/usr/local/lib/python3.6/dist-packages/imgaug/augmentables/bbs.py in <listcomp>(.0)
923 ia.do_assert(xyxy.shape[1] == 4, "Expected input array of shape (N, 4), got shape %s." % (xyxy.shape,))
924
--> 925 boxes = [BoundingBox(*row) for row in xyxy]
926
927 return cls(boxes, shape)
/usr/local/lib/python3.6/dist-packages/imgaug/augmentables/bbs.py in __init__(self, x1, y1, x2, y2, label)
45 if x1 > x2:
46 x2, x1 = x1, x2
---> 47 ia.do_assert(x2 >= x1)
48 if y1 > y2:
49 y2, y1 = y1, y2
/usr/local/lib/python3.6/dist-packages/imgaug/imgaug.py in do_assert(condition, message)
1867 """
1868 if not condition:
-> 1869 raise AssertionError(str(message))
1870
1871
AssertionError: Assertion failed.
Converting all_labels.csv to YOLOv3 format
Actually not an issue, but maybe you can help me out in this.
I need the label information for YOLO training. For each image, there is a separate txt file containing the location of the bbox. For the training, I need the following order:
class_number x_center y_center width_bbox height_bbox
The values are not absolute, but rational to the width and height.
For example:
0 0.50 0.50 0.15 0.15
This example means the x_min and y_min are in the center of the image.
width and height are 0.15 of the image, however, if the width differs from height (f.e. 600x450), the bbox is not a square, but a rectangle.
At the end, the dataset in the directory for YOLO-training contains following:
ABC.jpg
ABC.txt
DEF.jpg
DEF.txt
...
Do you know how I can solve the convertion to YOLO format with using python?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.