I'm trying to create custom dataset using my own images. This images I cropped from logs data such as below:
https://drive.google.com/open?id=1x0oWiVZ9KOw5P0gIMxQNxO-ajdrGy7Te
I want it to be able to detect the high vibration such as below:
https://drive.google.com/open?id=1tUjthjGG1c23kTCQZOgedcsx99R_a_z3
I have around 300 image of the High Vibration in one folder. the picture is like below:
https://drive.google.com/open?id=1IG_-wRJxe-_TOYfSxHjRq5UBWMn9mO1k
I wanted to do exactly like https://towardsdatascience.com/how-to-train-your-own-object-detector-with-tensorflows-object-detector-api-bec72ecfe1d9. IN this example image dataset was hand-labeled manually with LabelImg.
However I don't see why I need to draw box for images that only have one object in it and can have the frame of the image as the bounding box.
Please advice how I can create data set and processing the images without manually drawing the bounding box (since the images consist of one object), and how to draw bounding boxes in batch for image that contain one object(i.e. having the frame of the image as the bounding box)?
It sounds like you want to do 'image classification' as opposed to 'object detection' -- it may be easier to make a script that generates xml files, containing the image's width and height as bounding box dimensions, as opposed to using labelImg.
Related
so I am trying to create an algorithm that is able to distinguish bounding boxes for different images, and after several steps of image processing I was able to get a fairly accurate bounding box. I used this binary image to find labels of each box, and for some reason the first box remain undetected even though it has very similar shape to its adjacent boxes. The labeled boxes are shown below. Does anyone know the cause of this? [Binary bounding box as an input to label and regionprops][Labeled boxes]
I expected all the boxes to be labeled as they are closed region and its shape is very similar to other boxes found
I want to crop images which is already annotated for yolov5 format ".txt", but the coordinates will change on cropped so how can i update it and the image crop coordinate will also be one of the class in annotation .txt file. For example: there is two model i want to train first will just detect odometer and second will detect the digits in it so for second model first model will crop odometer image and send to second, therefore for training the second model i need this coordinates corrected. Because I already have full annotation ready and don't want to redo annotation on cropped images of like more than 2k images
As I have mentioned in the comments, I think I can write that as an answer as well.
You can crop your images from yolov5 with --save-crop flag of yolov5. And then for the annotations, you can actually give out full image size as the bounding box sizes. I suggest you check out this thread as well.
So here is my first question here. I am preparing a dataset for object detection. I have done the following things so far:
I have an original picture (size w4000 x h3000).
I used the annotation platform Roboflow to annotate it in COCO format, with close to 250 objects in the picture.
Roboflow returned a downscaled picture (2048x1536) with a respective json file with the annotations in COCO format.
Then, to obtain a dataset from my original picture (as I have a lot of objects and the picture is big enough), I decided to tile the original picture in patches of 224x224. For this purpose, I upscaled a bit (4032x3136) to be able to slice it properly, obtaining 252 pictures.
QUESTIONS
How can I resize the bounding boxes of the Roboflow 2048x1536 picture to my original picture (4032x3136)?
Once the b.boxes are resized to my original size picture, how can I resize them again, adapting the size to each of my patches (224x224) created by slicing the original picture?
Thank you!!
It sounds like the ultimate goal is to have tiled 224x224 images from the source 4032x3136 images with bounding boxes correctly updated.
In Roboflow, at least, you can add tiling as a preprocessing step to your original 4032x3136 images. The images will be broken into the number of tiles you select (2x2, 3x3, NxY). The bounding boxes will be correctly updated to cover the objects across each individual tile as well.
To reimplement in code from what you've described, you would need to:
Upscale your 2048x1536 images to 4032x3136
Scale the bounding boxes accordingly
Break the images into 224x224 tiles using something like Pil
Update the annotations to be broken into the coordinates on the respective tiles; one annotation per tile
I have a frame running with a small bounding box on the forehead. While if some certain condition is met the image must be saved. So when I use cv2.imwrite(filename,frame) , it saves the current frame but what I need is an image that doesn't contain a bounding box.
(i.e) My live webcam feed must have a small bounding box at my forehead but when I save that image I the bounding box must not be present in the final image that is saved into the directory.
Just keep 2 copies of same frame, one with bounding box and one with clean image. when certain condition is met save the clean one. I think that it is much easier and cleaner solution than removing the bounding box.
I want to create a synthetic dataset for character recognition from images. I have a list of words or sequences as text data that I want to draw as images with different fonts and font sizes.
I am using PIL python library for drawing text on images. But the problem is, when the text is drawn in different font sizes, I got stuck to get the coordinates of individual character for drawing the bounding box.
[![enter image description here][2]][2]
Any idea, code chunk or suggestion of any convenient resource would be very helpful.