axela2525
axela2525

Reputation: 27

What is the input size of the image to CNN when performing object detection with the model created by Tensorflow Object Detection API?

I used the Tensorflow Object Detection API (TF1) and created a file of frozen_inference_graph.pb of Faster R-CNN. After that, I was able to apply object detection to the image using "Object_detection_image.py" in the GitHub repository below.

EdjeElectronics/TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10

When I use this code, how large is the input size of images to Faster R-CNN? I set both "min_dimension" and "max_dimension" of "image_resizer {" in the config file to 768. When I perform object detection, is the input size of images to Faster R-CNN automatically resized to this size? The size of my images I prepared is 1920 x 1080 pixels, and I think it has been resized to 768 x 768 pixels.

If anyone knows about this, please let me know.

Thank you!

Upvotes: 0

Views: 573

Answers (1)

draganstankovic
draganstankovic

Reputation: 5426

Assuming you're using Object_detection_image.py you can modify the code to print out the size of image being used:

# ... 
image = cv2.imread(PATH_TO_IMAGE) 

# Add this after line 92:
height, width, channels = image.shape
print height, width, channels 

image_rgb = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
...

Upvotes: 1

Related Questions