Search code examples
tensorflowobject-detection-api

Problem with direction sensitive image-data


I´m new here, so please be kind and teach me if I did not provide all the information you need :)

I need to detect objects by object detection. Everything works fine for most of my object classes, but there is a problem:

I have some objects that are sensitive to their direction on the image. More precisely: I have objects that are aligned as "to the right" or "to the left" and should be recognized as such.

I already know that TensorFlow reflects the images randomly - which destroys my alignment, because left is right and right left. I come to this conclusion because all other objects are detected in a good amount and quality.

Therefore I want to "forbid" TensorFlow to mirror the images and only to rotate them instead.

I have already searched the Python classes and identified the function "tf.image.flip_left_right" which does the mirroring.

Now I don't know which of the many many files and places, where this method is called, I have to change (none of the scripts are mine, they all come natively with TensorFlow!)

Here are the scripts the method was called:

...\models\research\object_detection\core\preprocessor.py (1 hit)

...\models\research\object_detection\core\__pycache__\preprocessor.cpython-36.pyc (1 hit)

...\models\research\object_detection\training\events.out.tfevents.1559030641.R233689 (60 hits)

...\models\research\object_detection\training\graph.pbtxt (24 hits)

...above that: 36 Hits in every model.ckpt-XXXXX.meta-file

(which I dont think they are important for this problem?)

Has anyone had any experience with it and can give me any advice?

EDIT: I´m using TF in version 1.13


Solution

  • You should have a .config file somewhere which defines the augmentation applied to your images. See for example this file.
    Just remove random_horizontal_flip {} and you are done.