datature / portal

Portal is the fastest way to load and visualize your deep neural networks on images and videos 🔮

Home Page:https://datature.io/portal

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Show prediction labels

alemelis opened this issue · comments

Hey there, amazing tool, thanks for sharing!

I wonder if it is possible to draw the class label along with the bounding box for each prediction (possibly with the possibility of turning on/off the feature)

Actually, this bit of the code is supposed to do that, is that the case this works only for tf2 models?

cv2.putText(
img_arr,
"Class: {}, Score: {}".format(
str(category_index[str(classes[idx])]["name"]),
str(round(scores[idx], 2)),
),
(
int(each_bbox[1] * width),
int(each_bbox[2] * height + 10),
),
cv2.FONT_HERSHEY_SIMPLEX,
0.3,
(0, 0, 0),
1,
cv2.LINE_AA,
)

Hey @alemelis, thank you for the feedback, you read our minds. That's an idea that we are currently working on! Currently, if you hover over the boxes or masks, it does show the labels. Since the frontend bounding boxes, masks, and images are rendered by leaflet, it will be more of an update of the leaflet / front-end side of things.

I believe that the cv2.putText was for there to run tests as well as save the inference results to an image (for a potential feature we are pushing out) - I'll be sure to update this issue as we roll out the label changes.

Hey @alemelis, we have some working prototype in one of our branches and I'd like to check with you pertaining to our implementation - are you looking for something like this?

image (13)

@gkeechin
that looks awesome!

will there be a toggle to turn on/off the labels?

@alemelis - Yes! It will be hotkey L. I have settled on the aesthetics and done the tests on various browsers. This feature will be bundled in our upcoming v0.55 update and Ill drop you a ping here when its in release. Should be done in the next few days.

Thank you for your patience and can't wait to hear your feedback

Hey @alemelis - The changes are in the current releases branch. If you are using python3 portal.py to run the application, you should be able to press L to reveal all the tooltips.

Let me know if you have further suggestions or feature request - just open a new issue!