cvhciKIT / sloth

Sloth is a tool for labeling image and video data for computer vision research.
Other
608 stars 199 forks source link

Adding class name to item display #143

Open JeffOnGithub opened 6 years ago

JeffOnGithub commented 6 years ago

It makes it a lot easier to work with as you can see what classes are on your image.

    #Add class to screen display
self._text = "<div style='background-color:#111111;'>" + model_item.data(0) + "</div>"

self._text_bg_brush = None
    self._text_item = QGraphicsTextItem(self)

x = 0
y = 0
try:    
        x = int(model_item["xn"].split(";")[0].split(".")[0])
    y = int(model_item["yn"].split(";")[0].split(".")[0])
except:
    pass

    self._text_item.setPos(x, y)

This replace

self._text_item.setPos(0, 0)

in BaseItem init in items.py