Category : object-detection

So here is my code: import tensorflow as tf import tensorflow_hub as hub import cv2 import numpy as np import matplotlib.pyplot as plt detector = hub.load(‘https://tfhub.dev/tensorflow/ssd_mobilenet_v2/2’) img = cv2.imread(‘istockphoto-1148205303-1024×1024.jpg’) (w,h) = img.shape[:2] print((w,h)) img = img.reshape(1, h, w, 3) detections = detector(img) min_conf = 0.5 img = img.reshape((w, h, 3)) for i in range(0, int(detections[‘num_detections’][0])): ..

Read more

I’m following object detection tutorial from [nicknochnack/RealTimeObjectDetection][1] The code is available in the tutorial github repo under Tensorflow/Tutorial.ipynb The error I get is at "step 8: Detect in Real-time" upon executing the while loop. ValueError Traceback (most recent call last) in () 4 5 input_tensor = tf.convert_to_tensor(np.expand_dims(image_np, 0), dtype=tf.float32) —-> 6 detections = detect_fn(input_tensor) 7 ..

Read more