Closed RiyazAtar closed 4 years ago
That's because you need to call the 'Writer' function and the 'writer.save' function once. You can call the writer.addObject() any number of times between the first two
@shrnssh I am not getting how to do that in my program. If I call writer save function multiple times it will overwrite the existing bounding box info.
writer = Writer('path/to/img.jpg', 800, 400)
writer.addObject('cat', 100, 100, 200, 200)
writer.addObject('dog', 300, 300, 400, 400)
writer.addObject('ball', 50, 50, 75, 75)
writer.save('path/to/img.xml')
Think this should answer the question, please comment again if you'd like me to reopen.
I am using this library to convert annotation from text format to Pascal format. In text file each line represent path of image and bounding bound box values for single object. Now, If image consist of multiple of objects, then for single image in text file multiple lines will be there for each bounding box. I access each line individually to create xml file. Suppose image im1.jpg consist of 3 objects thesn as given below 3 boxes will be there as shown below
im1.jpg;1030;441;1050;461;5 im1.jpg;375;407;411;443;5 im1.jpg;1273;381;1313;421;5
here as i am saving file 3 times my old xml file gets overwritten instead of appending the new object. Thanks
Hi @tanajikamble13 - you'll need to write your program in a way that ensures all of the objects you need are known before you call save()
.
Hi, how to write multibox in one image with single class type?
if we have more classes in single image , then it adds only one class information.