TRT_Ultra_Fast_Lane_Detect
TRT_Ultra_Fast_Lane_Detect copied to clipboard
The result can not display correctly
hey, @KopiSoftware thanks your nice code ,i had get the trt model,but i have a problem about display the result on image.
the err code:
out_j = trt_outputs[0].reshape(101, 56, 4)
prob = scipy.special.softmax(out_j[:-1, :, :], axis=0)
idx = np.arange(100) + 1
idx = idx.reshape(-1, 1, 1)
loc = np.sum(prob * idx, axis=0)
out_j = np.argmax(out_j, axis=0)
loc[out_j == 100] = 0
out_j = loc
for i in range(out_j.shape[1]):
if np.sum(out_j[:, i] != 0) > 2:
for k in range(out_j.shape[0]):
if out_j[k, i] > 0:
ppp = (int(out_j[k, i] * col_sample_w * img_w / 800) - 1,
int(img_h * (row_anchor[cls_num_per_lane - 1 - k] / 288)) - 1)
cv2.circle(frame, ppp, 5, (0, 255, 0), -1)
i use pytorch code is correct:
out_j = out[0].data.cpu().numpy()
out_j = out_j[:, ::-1, :]
prob = scipy.special.softmax(out_j[:-1, :, :], axis=0)
idx = np.arange(cfg.griding_num) + 1
idx = idx.reshape(-1, 1, 1)
loc = np.sum(prob * idx, axis=0)
out_j = np.argmax(out_j, axis=0)
loc[out_j == cfg.griding_num] = 0
out_j = loc
for i in range(out_j.shape[1]):
if np.sum(out_j[:, i] != 0) > 2:
for k in range(out_j.shape[0]):
if out_j[k, i] > 0:
ppp = (int(out_j[k, i] * col_sample_w * img_w / 800) - 1, int(img_h * (row_anchor[cls_num_per_lane-1-k]/288)) - 1 )
cv2.circle(frame,ppp,5,(0,255,0),-1)
Yeeeeeeeeeeeeeeeeeeeeesss, there is some problem with my code, but I so busy recently. Thanks for your attribution. I will try it out lately.
Apologize, I was gonna say " thanks for your contribution".