Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/tensorflow/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用TensorFlow对象检测提取输出分数、类、id和框_Tensorflow_Object Detection_Object Detection Api - Fatal编程技术网

使用TensorFlow对象检测提取输出分数、类、id和框

使用TensorFlow对象检测提取输出分数、类、id和框,tensorflow,object-detection,object-detection-api,Tensorflow,Object Detection,Object Detection Api,据此,。 我的是; 让我们假设有一张图片包含3只猫、2只狗和1只鸟。 在检测到整个对象后,我们如何获得分离的6个对象的xmin-ymin-xmax-ymax值。在这些行之后 (boxes, scores, classes, num_detections) = sess.run( [boxes, scores, classes, num_detections], feed_dict={image_tensor: image_np_expanded})

据此,。 我的是; 让我们假设有一张图片包含3只猫、2只狗和1只鸟。 在检测到整个对象后,我们如何获得分离的6个对象的xmin-ymin-xmax-ymax值。

在这些行之后

    (boxes, scores, classes, num_detections) = sess.run(
          [boxes, scores, classes, num_detections],
          feed_dict={image_tensor: image_np_expanded})
您可以检索需要查找的信息

    boxes, scores, classes, num_detections
在这几行之后

    (boxes, scores, classes, num_detections) = sess.run(
          [boxes, scores, classes, num_detections],
          feed_dict={image_tensor: image_np_expanded})
您可以检索需要查找的信息

    boxes, scores, classes, num_detections

在Python中,它看起来像

    # this loop Counting the Objects found from highest to lowest %, Default is 100Results. Only > x% get counted
        scores = output_dict['detection_scores'] as example
        boxes = output_dict['detection_boxes'] as example
        classes = output_dict['detection_classes'] as example
        count=0  
        xmin=[]
        xmax=[]
        ymin=[]
        ymax=[] 
        classlist=[]         
        for s in range (100):
            if scores is None or scores [s] > 0.5:
                count = count + 1
        for i in range (count):
            position = np.squeeze(boxes[0][i])
            (xmin, xmax, ymin, ymax) = (position[1]*im_width, position[3]*im_width, position[0]*im_height, position[2]*im_height)
        xmin.append(xmin)
        xmax.append(xmax)
        ymin.append(ymin)
        ymax.append(ymax)
        classlist.append(classes[i])
列表按得分从高到低排序。
很抱歉,我是新手。

在Python中,它看起来像

    # this loop Counting the Objects found from highest to lowest %, Default is 100Results. Only > x% get counted
        scores = output_dict['detection_scores'] as example
        boxes = output_dict['detection_boxes'] as example
        classes = output_dict['detection_classes'] as example
        count=0  
        xmin=[]
        xmax=[]
        ymin=[]
        ymax=[] 
        classlist=[]         
        for s in range (100):
            if scores is None or scores [s] > 0.5:
                count = count + 1
        for i in range (count):
            position = np.squeeze(boxes[0][i])
            (xmin, xmax, ymin, ymax) = (position[1]*im_width, position[3]*im_width, position[0]*im_height, position[2]*im_height)
        xmin.append(xmin)
        xmax.append(xmax)
        ymin.append(ymin)
        ymax.append(ymax)
        classlist.append(classes[i])
列表按得分从高到低排序。 对不起,我是新手