-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Testing Images in Folder #1
Comments
You can using the concept of File Handling (os library) in Python.
|
Will this work on google colab? |
IMAGE_PATH = os.path.join(paths['IMAGE_PATH'], 'test', 'livelong.02533422-940e-11eb-9dbd-5cf3709bbcc6.jpg') img = cv2.imread(IMAGE_PATH) input_tensor = tf.convert_to_tensor(np.expand_dims(image_np, 0), dtype=tf.float32) num_detections = int(detections.pop('num_detections')) detection_classes should be ints.detections['detection_classes'] = detections['detection_classes'].astype(np.int64) label_id_offset = 1 viz_utils.visualize_boxes_and_labels_on_image_array( plt.imshow(cv2.cvtColor(image_np_with_detections, cv2.COLOR_BGR2RGB)) As this code is used for detecting single image. How can I use this for my folder which has 50 images. |
Check if this will work and make required changes with respect to path. |
what is the name argument here?? I will try this code. if it doesnot work, I will let you know |
name argument is the image file name. |
Please guide me on how to provide file paths properly. |
"Path" variable should be your folder path. i.e., path = "/content/drive/MyDrive/DetectionApi/workspace/images/test" Make below changes: Change1 Change 2 in the loop After making all the changes try to run. |
(Path+x) is giving me error |
As this is the code for giving image path for single image This is the code for detection function Restore checkpointckpt = tf.compat.v2.train.Checkpoint(model=detection_model) @tf.function This is the code for reading image . input_tensor = tf.convert_to_tensor(np.expand_dims(image_np, 0), dtype=tf.float32) num_detections = int(detections.pop('num_detections')) detection_classes should be ints.detections['detection_classes'] = detections['detection_classes'].astype(np.int64) label_id_offset = 1 viz_utils.visualize_boxes_and_labels_on_image_array( plt.imshow(cv2.cvtColor(image_np_with_detections, cv2.COLOR_BGR2RGB)) Considering this code can you just guide me on how to run this for the complete folder. Actually I have used tensorflow object detection api for training a model. After successful training, I have evaluate my model so it is giving me mAP and loss. But I want my model to show accuracy but it is not. |
Can we connect to check the error you are facing? |
Yes sure I will send you email tomorrow |
I am using Tensorflow object detection Api. I have completed training and have download the trained model through "Python export_v2.py " code.
Now I want to test my model on my test Images folder.
There are many codes that can read and detect single image. But I want to detect my all 50 images that are on my folder.
Kinldy please help me do that.. Thanks in advance
The text was updated successfully, but these errors were encountered: