datitran/object_detector_app

Hold up... Are these tensorflow models trained in RGB or BGR?

apockill opened this issue · 5 comments

I have reason to believe that the tensorflow models have been trained with image arrays in RGB format, but this codebase loads images using OpenCV, which defaults to BGR.

This issue is plaguing me at work on a different project, and I want to confirm: Should I feed it an RGB image or a BGR image?

If anyone knows, this would be quite helpful!

hi @apockill

no idea, but if it's the case, I wonder if that would be what causes no detection in the app, but great detection using the object_detection jupyter notebook.

datitran/raccoon_dataset#25

Hahaha oh man I'm so glad I found this issue. Yeah, that's the problem. Throw a cv2.cvtcolor(bgr2gray) or whatever in there, should run great!

@apockill

3 questions

  1. doesn't that turn your video gray?
  2. where did you put it?
  3. what do you mean by "or whatever"? are you saying that it's bgr and needs to be changed to anything but bgr?

Hey @apockill, thanks for pointing this out. You're right. Actually for another project I was doing the bgr2rgb and vice versa conversion and the raccoon video is also used with this codebase. I updated the code. Next time you could also do a pull request! Thanks again!