Closed VYRION-Ai closed 3 years ago
Hello @totoadel we don’t currently have that visualization but it would be cool to add it. Do you have an example video of what you’re looking for? And how many frames back does the tracing line follow?
yes like what happened here in this video. https://www.youtube.com/watch?v=Cu3ERM0Zk4s and all frames the object are still founded.
Ok cool - thanks for the example, we will put it on the list of todo
If you want to try a PR, it would be maintaining a dictionary for each object with history of box center locations, then plotting that line at visualization time
than you very much @Jacobsolawetz
Ok cool - thanks for the example, we will put it on the list of todo
If you want to try a PR, it would be maintaining a dictionary for each object with history of box center locations, then plotting that line at visualization time
i did it thank you very much. @Jacobsolawetz
this is the code
height, width, _ = im0.shape
x1, y1, x2, y2 = max(0, int(bboxes[0])), max(0, int(bboxes[1])), min(width,
int(bboxes[2])), min(
height, int(bboxes[3]))
center = (int((x1 + x2) / 2), int((y1 + y2) / 2))
chk = checkKey_track(id_track, (id))
if chk == 1:
resl=all_values(id_track, id)
for key in list (resl):
cv2.circle(im0, resl[key], radius=5, color=color, thickness=-1)
upd_dict = {(count_id): center}
id_track[(id)].update(upd_dict)
else:
upd_dict = {(count_id): center}
id_track[(id)]=(upd_dict)
def checkKey_track(dict, key):
if key in dict.keys():
return 1
else:
return 0
def all_values(dict_obj,ids):
for p_id, p_info in dict_obj.items():
if ids == p_id:
for key in p_info:
p_info[key]
return p_info
Nice! Can you post an example video?
@maxhs2014, let's take a look this week together
let me upload video to you tube
https://youtu.be/HlvybeSzbqs I'm very happy, because I'm a Java developer, not Python,
Ok cool - thanks for the example, we will put it on the list of todo If you want to try a PR, it would be maintaining a dictionary for each object with history of box center locations, then plotting that line at visualization time
i did it thank you very much. @Jacobsolawetz this is the code
height, width, _ = im0.shape x1, y1, x2, y2 = max(0, int(bboxes[0])), max(0, int(bboxes[1])), min(width, int(bboxes[2])), min( height, int(bboxes[3])) center = (int((x1 + x2) / 2), int((y1 + y2) / 2)) chk = checkKey_track(id_track, (id)) if chk == 1: resl=all_values(id_track, id) for key in list (resl): cv2.circle(im0, resl[key], radius=5, color=color, thickness=-1) upd_dict = {(count_id): center} id_track[(id)].update(upd_dict) else: upd_dict = {(count_id): center} id_track[(id)]=(upd_dict)
def checkKey_track(dict, key): if key in dict.keys(): return 1 else: return 0 def all_values(dict_obj,ids): for p_id, p_info in dict_obj.items(): if ids == p_id: for key in p_info: p_info[key] return p_info
Which file to add these codes?
Ok cool - thanks for the example, we will put it on the list of todo If you want to try a PR, it would be maintaining a dictionary for each object with history of box center locations, then plotting that line at visualization time
i did it thank you very much. @Jacobsolawetz this is the code
height, width, _ = im0.shape x1, y1, x2, y2 = max(0, int(bboxes[0])), max(0, int(bboxes[1])), min(width, int(bboxes[2])), min( height, int(bboxes[3])) center = (int((x1 + x2) / 2), int((y1 + y2) / 2)) chk = checkKey_track(id_track, (id)) if chk == 1: resl=all_values(id_track, id) for key in list (resl): cv2.circle(im0, resl[key], radius=5, color=color, thickness=-1) upd_dict = {(count_id): center} id_track[(id)].update(upd_dict) else: upd_dict = {(count_id): center} id_track[(id)]=(upd_dict)
def checkKey_track(dict, key): if key in dict.keys(): return 1 else: return 0 def all_values(dict_obj,ids): for p_id, p_info in dict_obj.items(): if ids == p_id: for key in p_info: p_info[key] return p_info
Which file to add these codes?
Detect.py
I can't find detect.py, can you help me in detail? thank you
Ok cool - thanks for the example, we will put it on the list of todo If you want to try a PR, it would be maintaining a dictionary for each object with history of box center locations, then plotting that line at visualization time
i did it thank you very much. @Jacobsolawetz this is the code
height, width, _ = im0.shape x1, y1, x2, y2 = max(0, int(bboxes[0])), max(0, int(bboxes[1])), min(width, int(bboxes[2])), min( height, int(bboxes[3])) center = (int((x1 + x2) / 2), int((y1 + y2) / 2)) chk = checkKey_track(id_track, (id)) if chk == 1: resl=all_values(id_track, id) for key in list (resl): cv2.circle(im0, resl[key], radius=5, color=color, thickness=-1) upd_dict = {(count_id): center} id_track[(id)].update(upd_dict) else: upd_dict = {(count_id): center} id_track[(id)]=(upd_dict)
def checkKey_track(dict, key): if key in dict.keys(): return 1 else: return 0 def all_values(dict_obj,ids): for p_id, p_info in dict_obj.items(): if ids == p_id: for key in p_info: p_info[key] return p_info
Which file to add these codes?
Detect.py
hi @Jacobsolawetz and @maxhs2014 i want to draw a tracing line for the object , how i can i do that?