Open ghimireadarsh opened 1 year ago
Hello, can you tell me how to run through the code? I don't quite understand
使用提供的模型检查点测试了代码,但我最多只能获得 8 FPS。
11th Gen Intel(R) Core (TM) i7-11700 @ 2.50GHz
Hello, can you tell me how to run through the code? I don't quite understand
Hi, do you want to run for inference or training?
使用提供的模型检查点测试了代码,但我最多只能获得 8 FPS。
11th Gen Intel(R) Core (TM) i7-11700 @ 2.50GHz
Hello, can you tell me how to run through the code? I don't quite understand
inference or training?
I want to try it first inference,If the algorithm is real-time, I want to try training
inference or training?
I want to try it first inference,If the algorithm is real-time, I want to try training
I ran it from pytracking, and it is not giving me real-time performance at all.
def track(self, im, state_input, writer=None): self.frame_num += 1
state = state_input['previous_output']
p = state['p']
avg_chans = state['avg_chans']
window = state['window']
target_pos = state['target_pos']
target_sz = state['target_sz']
hc_z = target_sz[1] + p.context_amount * sum(target_sz)
wc_z = target_sz[0] + p.context_amount * sum(target_sz)
s_z = np.sqrt(wc_z * hc_z)
scale_z = p.exemplar_size / s_z
d_search = (p.instance_size - p.exemplar_size) / 2 # slightly different from rpn++
pad = d_search / scale_z
s_x = s_z + 2 * pad
x_crop, _ = get_subwindow_tracking(im, target_pos, p.instance_size, python2round(s_x.item()), avg_chans)
state['x_crop'] = x_crop.clone() # torch float tensor, (3,H,W)
x_crop = self.normalize(x_crop)
x_crop = x_crop.unsqueeze(0)
debug = True
if debug:
target_pos, target_sz, _, cls_score = self.update(x_crop, target_pos, target_sz * scale_z,
window, scale_z, p, debug=debug, writer=writer)
state['cls_score'] = cls_score
else:
target_pos, target_sz, _ = self.update(x_crop, target_pos, target_sz * scale_z,
window, scale_z, p, debug=debug, writer=writer)
target_pos[0] = max(0, min(state['im_w'], target_pos[0]))
target_pos[1] = max(0, min(state['im_h'], target_pos[1]))
target_sz[0] = max(10, min(state['im_w'], target_sz[0]))
target_sz[1] = max(10, min(state['im_h'], target_sz[1]))
#print("cropped x shape: ", x_crop.shape)
#print("target pos shape: ", target_pos.shape)
#print("target size shape: ", target_sz.shape)
#print("target size: ", target_sz)
# TODO: compute appropriate bounding box in x,y,w,h format (?) and return it
location = cxy_wh_2_rect(target_pos, target_sz)
# set lighttrack params
state['target_pos'] = target_pos
state['target_sz'] = target_sz
state['p'] = p
# set pytracking params
state['target_bbox'] = location
#print("location: ", location)
Yes, the frame rate is very low. Well, I remember debugging the code and fixing the issues. And the first one which I remember is commenting out the state = state_input['previous_output']
.
state = state_input['previous_output'] The first is to comment out that I have finished but there are still errors. Do you remember.?
Can you put the error you are getting so that I can directly look into those codes and will put the resolution here?
Traceback (most recent call last):
File "E:/Track/E.T.Track/ettrack-main/pytracking/run_webcam.py", line 41, in
Make the following edits.
diff --git a/pytracking/evaluation/tracker.py b/pytracking/evaluation/tracker.pyindex 634173f..e7ba305 100644
--- a/pytracking/evaluation/tracker.py
+++ b/pytracking/evaluation/tracker.py
@@ -295,7 +295,7 @@ class Tracker:
x, y, w, h = cv.selectROI(display_name, frame_disp, fromCenter=False)
init_state = [x, y, w, h]
- tracker.initialize(frame, _build_init_info(init_state))
+ state_input = tracker.initialize(frame, _build_init_info(init_state))
output_boxes.append(init_state)
break
@@ -308,8 +308,14 @@ class Tracker:
frame_disp = frame.copy()
# Draw box
- out = tracker.track(frame)
- state = [int(s) for s in out['target_bbox'][1]]
+ timer = cv.getTickCount()
+ out = tracker.track(frame, state_input)
+ fps = cv.getTickFrequency() / (cv.getTickCount() - timer)
+ # state = [int(s) for s in out['target_bbox'][1]]
+ state = [int(s) for s in out['target_bbox']]
+
+
+
diff --git a/pytracking/tracker/et_tracker/et_tracker.py b/pytracking/tracker/et_tracker/et_tracker.py
index 02645a5..d70656e 100644
--- a/pytracking/tracker/et_tracker/et_tracker.py
+++ b/pytracking/tracker/et_tracker/et_tracker.py
@@ -48,7 +48,7 @@ class TransconverTracker(BaseTracker):
tic = time.time()
# Get target position and size
- state = torch.tensor(info['init_bbox']) # x,y,w,h
+ state = torch.tensor(info['init_bbox'][1]) # x,y,w,h
I have modified all three of your settings, but there are still problems running on cmd.I put the checkpoint_ E35. pth is placed under the pytracking \networks file. Is there anything wrong with meHere is my error report.
(pptracking3.7) E:\Track\E.T.Track\ettrack-main\pytracking>python run_video.py et_tracker et_tracker 11.pm4
checkpoint epoch provided: 35
checkpoint path: ./checkpoints/et_tracker\checkpoint_e35.pth
loading model from: ./checkpoints/et_tracker\checkpoint_e35.pth
loading the checkpoint strict: True
ERROR:root:No checkpoint found at './checkpoints/et_tracker\checkpoint_e35.pth'
Traceback (most recent call last):
File "run_video.py", line 38, in
put the checkpoint file inside checkpoints/et_tracker/checkpoint_e35.pth
Sorry, I'm a novice, I don't understand very much, I didn't find it checkpoints/et_tracker/checkpoint_e35.pth ,where is 'checkpoints' file?Does this algorithm need the same environment as pytrackin? Sorry to bother you.
In the root of this repository, not inside the pytracking.
In the root of this repository, not inside the pytracking.
Thank you very much. I'm already running. But also, my frame rate is very low
In the root of this repository, not inside the pytracking.
Thank you very much. I'm already running. But also, my frame rate is very low
You are welcome. May I know how much frame rate are you getting? And your device information?
Tested the code with provided model checkpoint on
11th Gen Intel(R) Core (TM) i7-11700 @ 2.50GHz
, but I am only getting maximum of 8 FPS.
你是不是把测试数据存放在了外置机械硬盘里面?我用i5-10400也跑到了平均50FPS。
In the root of this repository, not inside the pytracking.
Thank you very much. I'm already running. But also, my frame rate is very low
You are welcome. May I know how much frame rate are you getting? And your device information?
我明白了!作者使用的计算帧率的方法与我们的想法不同,你的8FPS应该是用序列的帧数除以处理该序列所需的时间得到(这样算的话我只有7.6FPS),但是,在代码(/pytracking/evaluation/tracker.py 211-218行)中,作者只计算了模型处理一帧图像所需的时间(约0.019s),而不是我们感性认识到的处理时间(其中还包含了从硬盘中加载帧图像的时间!),所以,按照作者的计算方法,确实可以达到50+FPS!
How to training?Thanks,please tell me
How to training?Thanks,please tell me It seems that there is no publicly available training code yet
In the root of this repository, not inside the pytracking.
Thank you very much. I'm already running. But also, my frame rate is very low
You are welcome. May I know how much frame rate are you getting? And your device information?
i running in gpu gtx1050,only around 10fps
In the root of this repository, not inside the pytracking.
Thank you very much. I'm already running. But also, my frame rate is very low
You are welcome. May I know how much frame rate are you getting? And your device information?
我明白了!作者使用的计算帧率的方法与我们的想法不同,你的8FPS应该是用序列的帧数除以处理该序列所需的时间得到(这样算的话我只有7.6FPS),但是,在代码(/pytracking/evaluation/tracker.py 211-218行)中,作者只计算了模型处理一帧图像所需的时间(约0.019s),而不是我们感性认识到的处理时间(其中还包含了从硬盘中加载帧图像的时间!),所以,按照作者的计算方法,确实可以达到50+FPS!
The time taken to read the image has been excluded, and the author covers all frames with the processing time of the first frame to achieve higher speeds, without explanation, which I think is a serious problem. I changed the fps calculation method and found that it barely satisfies real-time on my CPU(amd ryzen 6900hx), around 24fps on the GOT10K test set.
Tested the code with provided model checkpoint on
11th Gen Intel(R) Core (TM) i7-11700 @ 2.50GHz
, but I am only getting maximum of 8 FPS.