danmacnish/cartoonify

Anyway to see the tensor-flow image recognition picture

Opened this issue · 1 comments

Awesome project, I want to take this one step further and wanted to know if you had some insight on how to have the program also show the object_detection file. By this, I mean displaying a picture of the image given, with the boxes around it showing what the program thought an object was which would lead to the drawing. I figure the program does this, so I feel it should be fairly simple to just pull that step out so it can show the image given with the detected parts.

Thanks for the help, what I'm looking for it to display is something like the image below
image

Yep, this is certainly possible - you're looking for imageprocessor.annotate_image(), and the corresponding call in workflow.py. I commented out this code, as it required matplotlib as a dependency, and it was non-trivial to get it working on the pi.

    def annotate_image(self, image, boxes, classes, scores, threshold=0.5):
        """draws boxes around the detected objects and labels them
        :return: annotated image
        """
        annotated_image = image.copy()
        # vis_util.visualize_boxes_and_labels_on_image_array(
        #     annotated_image,
        #     np.squeeze(boxes),
        #     np.squeeze(classes).astype(np.int32),
        #     np.squeeze(scores),
        #     self._labels,
        #     use_normalized_coordinates=True,
        #     line_thickness=8,
        #     min_score_thresh=threshold)
        return annotated_image