Skip to content

Commit

Permalink
Minor changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nacho Condés committed Mar 6, 2020
1 parent 7f8cbd8 commit 5e5f0e0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
14 changes: 8 additions & 6 deletions GUI/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def __init__(self, parent=None):
self.logo_label.show()

self.font = cv2.FONT_HERSHEY_SIMPLEX
self.scale = 0.7
self.scale = 3

self.setWindowTitle("JdeRobot - ObjectDetector")

Expand Down Expand Up @@ -143,7 +143,9 @@ def updateOnce(self):


def renderModifiedImage(self):
image_np = np.copy(self.im_prev)
factor = 2
new_size = (self.cam.im_width*factor, self.cam.im_height*factor)
image_np = cv2.resize(np.copy(self.im_prev), new_size)

detection_boxes = self.network.boxes
detection_classes = self.network.predictions
Expand All @@ -153,10 +155,10 @@ def renderModifiedImage(self):
_class = detection_classes[index]
score = detection_scores[index]
rect = detection_boxes[index]
xmin = rect[0]
ymin = rect[1]
xmax = rect[2]
ymax = rect[3]
xmin = rect[0] * factor
ymin = rect[1] * factor
xmax = rect[2] * factor
ymax = rect[3] * factor
cv2.rectangle(image_np, (xmin, ymax), (xmax, ymin), self.colors[_class], 3)

label = "{0} ({1} %)".format(_class, int(score*100))
Expand Down
11 changes: 5 additions & 6 deletions objectdetector.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,10 @@
t_gui = ThreadGUI(window)
t_gui.start()

# print("")
# print("Requested timers:")
# print(" Camera: %d ms" % (t_cam.t_cycle))
# print(" GUI: %d ms" % (t_gui.t_cycle))
# print(" Network: %d ms" % (t_network.t_cycle))
# print("")
print('\nRequested framerates:')
print(f'\tCamera: {1000/t_cam.t_cycle} fps')
print(f'\tGUI: {1000/t_gui.t_cycle} fps')
print(f'\tNetwork: {1000/t_network.t_cycle} fps')
print('')

sys.exit(app.exec_())

0 comments on commit 5e5f0e0

Please sign in to comment.