TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10 icon indicating copy to clipboard operation
TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10 copied to clipboard

Accuracy For Detection (Issues)

Open mronda opened this issue 6 years ago • 24 comments

I ran the RCNN for around 3 hours and got up to 50K steps but when I tested the images I got weird accuracy when running random images. What could be the issue? Do I need more data sets?

Setup: Running on a GeForce GTX 970 with compute capability of 5.2.

image

Running some random objects image

mronda avatar Jun 06 '18 19:06 mronda

I am also interested in this. The tensorflow object detection api works well just on the trained dataset but ends up falsely classifying images that are not similar to the trained dataset. I'm not sure if this is the correct place to discuss but how to exclude images that are not part of the dataset? Can we include additional images the classifier might encounter and then place those images into a other category? It seems like the other category would need to have a very large number of images in it.

Djacob502 avatar Jun 07 '18 14:06 Djacob502

i also have the same problem, different checkpoints yields to different classes, but still the same problem!

Ibrahimq avatar Jun 13 '18 05:06 Ibrahimq

i have same problem, i trained my own dataset, only one class, but it detect this class even in picture where is not this object.... someone could answer us ? i tried from several days to make it work with no end...

leccyril avatar Jun 28 '18 07:06 leccyril

@leccyril i have same problem. in traning options, there is a parameter that resize the input images to 1024*600 with this code :

model { faster_rcnn { num_classes: 4 image_resizer { keep_aspect_ratio_resizer { min_dimension: 600 max_dimension: 1024 } }

in other hand, the orginal traning images of the tutorial has nearly same dimension.

so i think we must convert the training images to 1024*600 resolution.

have you got better way to solve it ?????

asxasxdscsd avatar Jul 15 '18 11:07 asxasxdscsd

i have same problem, i trained my own dataset, only one class, but it detect this class even in picture where is not this object.... someone could answer us ? i tried from several days to make it work with no end...

Exactly same issue. I just need to detect presence of some particular object(num_of_class = 1) and it captures every part of the frame. I am using ssdlite_mobilenet and planning to move run inference graph on raspberry pi3. How much iteration I should go for proper detection?

alper-d avatar Dec 17 '18 17:12 alper-d

i have same problem, i trained my own dataset, only one class, but it detect this class even in picture where is not this object.... someone could answer us ? i tried from several days to make it work with no end...

https://github.com/EdjeElectronics/TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10/issues/175 try the no ground truth images as your background images i am also working on that lets see whether it reduces error while detection or not

ZAFERSHAMIM avatar Mar 26 '19 09:03 ZAFERSHAMIM

i have same problem, i trained my own dataset, only one class, but it detect this class even in picture where is not this object.... someone could answer us ? i tried from several days to make it work with no end...

https://github.com/tensorflow/models/issues/5954 try implementing balajis comment about noground truth images where he talks about adding background images and reply if it works ,reduces your error i would do the same

ZAFERSHAMIM avatar Mar 26 '19 10:03 ZAFERSHAMIM

for this demo i just use the tutorial datas so i don't think we have to add things.... juste use like this but not working

leccyril avatar Mar 26 '19 12:03 leccyril

@ZAFERSHAMIM could you please tell me how to add background images. Do I just need to add background images to my CSV file? My CSV file has the following specifications: filename,width,height,class,xmin,ymin,xmax,ymax

So for a background image it should be: background.jpg,200,200,background,some number,some number,some number,some number

I don't need to add anything to the label .pbtxt file?

From that CSV file I can convert to TFR?

shamik111691 avatar Mar 27 '19 01:03 shamik111691

@ZAFERSHAMIM could you please tell me how to add background images. Do I just need to add background images to my CSV file? My CSV file has the following specifications: filename,width,height,class,xmin,ymin,xmax,ymax

So for a background image it should be: background.jpg,200,200,background,some number,some number,some number,some number

I don't need to add anything to the label .pbtxt file?

From that CSV file I can convert to TFR?

For adding background images you just need to add some images to train directory without their xml annotations after that follow the same procedure ,generate csv than tfr and run training. U dont need to change .pbtxt file and i am talking in context of faster rcnn models

ZAFERSHAMIM avatar Mar 27 '19 03:03 ZAFERSHAMIM

@ZAFERSHAMIM Thanks a lot. I don't have xml files. I just have CSV files which I am writing manually. So for these background images what will the CSV file contain. Right now my CSV file has the specifications: filename,width,height,class,xmin,ymin,xmax,ymax

So will it be filename.jpg,{width of file}, {height of file},background,,,,

Thanks for your help

shamik111691 avatar Mar 27 '19 04:03 shamik111691

for this demo i just use the tutorial datas so i don't think we have to add things.... juste use like this but not working

developers talked about that groundtruth images method u can give it a try cause everyone is facing that issue and its the only solution api developer has talked about. This weekend i will post my results whether that worked or not you can also try only training would take time nothing else.

ZAFERSHAMIM avatar Mar 27 '19 04:03 ZAFERSHAMIM

@ZAFERSHAMIM Thanks a lot. I don't have xml files. I just have CSV files which I am writing manually. So for these background images what will the CSV file contain. Right now my CSV file has the specifications: filename,width,height,class,xmin,ymin,xmax,ymax

So will it be filename.jpg,{width of file}, {height of file},background,,,,

Thanks for your help

nope you dont have to write xml files manualy u can use https://github.com/tzutalin/labelImg/releases labelimg it would create xml files automaticlly

ZAFERSHAMIM avatar Mar 27 '19 04:03 ZAFERSHAMIM

@ZAFERSHAMIM I am sorry for not being clear. I am not using XML files at all. I generate CSV files directly without using XML. Please let me know what will the CSV file entry for a background image look like. Thanks.

shamik111691 avatar Mar 27 '19 04:03 shamik111691

@ZAFERSHAMIM I am sorry for not being clear. I am not using XML files at all. I generate CSV files directly without using XML. Please let me know what will the CSV file entry for a background image look like. Thanks.

exactly i dont know that cos i will use generate csv script and it would auto generate csv for all data, My method is to add some images without xml files in train split of images and generate csv out of them.

ZAFERSHAMIM avatar Mar 27 '19 04:03 ZAFERSHAMIM

@ZAFERSHAMIM Once you generate the CSV file could you please let me know the value of the fields corresponding to the background image? Thanks, Shamik

shamik111691 avatar Mar 27 '19 04:03 shamik111691

i will give you csv and other output this weekend

ZAFERSHAMIM avatar Mar 27 '19 04:03 ZAFERSHAMIM

@ZAFERSHAMIM Thanks a lot. Looking forward to it.

shamik111691 avatar Mar 27 '19 04:03 shamik111691

i don't think we have to add background image in other discussions they explained that when your creating annotation on your picture there are areas not annotated, it is like background ...

and in his tutorial and in all tutorials i saw there is not "background" pictures

leccyril avatar Mar 27 '19 06:03 leccyril

i don't think we have to add background image in other discussions they explained that when your creating annotation on your picture there are areas not annotated, it is like background ...

and in his tutorial and in all tutorials i saw there is not "background" pictures

i watched a comment pkulzc he is developer of this api regarding adding that back ground images that is why i recommended you to do so

ZAFERSHAMIM avatar Mar 27 '19 06:03 ZAFERSHAMIM

so we put pictures without annotation where is not present our objects ?

leccyril avatar Mar 28 '19 08:03 leccyril

so we put pictures without annotation where is not present our objects ?

yes just put pictures without annotations

ZAFERSHAMIM avatar Mar 28 '19 08:03 ZAFERSHAMIM

does adding background images work for other models like ssd in tensorflow_api?

apoorva1999 avatar May 22 '19 18:05 apoorva1999

The models are pretrained on other datasets, that's right, but this is about learning shapes not exactly the content of the image. So if you train your own model and do transfer-learning, which is recommended, because training from scratch isn't an easy job, it should be possible to train it on customs classes. If you train on playing cards, it can't detect a car or a bus, the problem some of you describe here is overfitting, detecting false positives

Petros626 avatar Jul 29 '22 06:07 Petros626