Skip to content
Snippets Groups Projects
Commit ba0db039 authored by Johan Edstedt's avatar Johan Edstedt :speech_balloon:
Browse files

Merge branch '78-fix-bbox-bugs' into 'master'

fixes issue where negative bboxes from yolo gets wrapped to 65536 or something with uint

Closes #78

See merge request !16
parents 93ccea7b 4b35d9e0
Branches 79-fix-tracker-bookkeeping
Tags
1 merge request!16fixes issue where negative bboxes from yolo gets wrapped to 65536 or something with uint
Pipeline #55344 passed
...@@ -4,7 +4,7 @@ VisualSources sources_types ...@@ -4,7 +4,7 @@ VisualSources sources_types
uint8[] sources # Previous sources uint8[] sources # Previous sources
uint32[] sources_ids # The id which was originally given to this entity (same order as above) uint32[] sources_ids # The id which was originally given to this entity (same order as above)
uint16[4] bbox # [x1, y1, x2, y2] int32[4] bbox # [x1, y1, x2, y2]
float32[3] xyz [0.0,0.0,0.0] float32[3] xyz [0.0,0.0,0.0]
string type # Ex. person, apple, book string type # Ex. person, apple, book
float32 confidence float32 confidence
\ No newline at end of file
...@@ -87,7 +87,6 @@ class ReID: ...@@ -87,7 +87,6 @@ class ReID:
people = detections['person'] people = detections['person']
for person in people: for person in people:
if 'target_tracked_id' in person: if 'target_tracked_id' in person:
self.log.info('Already found target')
continue continue
#embed the person #embed the person
z = self.embed(person['bbox'],image) z = self.embed(person['bbox'],image)
......
...@@ -39,7 +39,6 @@ class Tracker(Node): ...@@ -39,7 +39,6 @@ class Tracker(Node):
""" """
timestamp = image_msg.header.stamp timestamp = image_msg.header.stamp
image = self.bridge.imgmsg_to_cv2(image_msg,desired_encoding='rgb8') image = self.bridge.imgmsg_to_cv2(image_msg,desired_encoding='rgb8')
self.log.info(str(timestamp))
if timestamp not in self.entities: if timestamp not in self.entities:
self.images[timestamp] = image self.images[timestamp] = image
else: else:
...@@ -47,8 +46,6 @@ class Tracker(Node): ...@@ -47,8 +46,6 @@ class Tracker(Node):
self.track(entities, image, timestamp) self.track(entities, image, timestamp)
def yolo_callback(self,entities_msg): def yolo_callback(self,entities_msg):
self.log.info("In yolo callback")
#FIXME: the timestamps dict may grow indefinitely if not all images are turned into yolo entities, should have some way of dealing with it
timestamp = entities_msg.time timestamp = entities_msg.time
entities = {ent.type:[] for ent in entities_msg.entities} entities = {ent.type:[] for ent in entities_msg.entities}
self.log.info(f"Yolo detected {len(entities_msg.entities)} targets") self.log.info(f"Yolo detected {len(entities_msg.entities)} targets")
......
...@@ -135,7 +135,7 @@ class YoloDetector(Node): ...@@ -135,7 +135,7 @@ class YoloDetector(Node):
scale_diff = self.original_size/self.rescale_size scale_diff = self.original_size/self.rescale_size
#Note that original_size and rescale size is height,width while preds are xyxy #Note that original_size and rescale size is height,width while preds are xyxy
true_bbox = np.array((det[0]*scale_diff[1], det[1]*scale_diff[0], true_bbox = np.array((det[0]*scale_diff[1], det[1]*scale_diff[0],
det[2]*scale_diff[1], det[3]*scale_diff[0])).astype(np.uint16) det[2]*scale_diff[1], det[3]*scale_diff[0])).astype(np.int32)
entity = Entity() entity = Entity()
entity.id = i entity.id = i
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment