Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write the values of the predicted bounding boxes in measure_map #94

Open
sivaramakrishnan-rajaraman opened this issue Sep 1, 2020 · 0 comments

Comments

@sivaramakrishnan-rajaraman

I wish to store the values of the predicted bounding boxes 'all_dets' for each test image to a CSV file so that I can use the predicted data for later use. I wish to write the values in the format 'img_name, x1, x2, y1, y2, key'. Could somebody help me how to do it?

for key in bboxes:
		bbox = np.array(bboxes[key])

		new_boxes, new_probs = roi_helpers.non_max_suppression_fast(bbox, np.array(probs[key]), overlap_thresh=0.3) #0.5 before gives the best map
		for jk in range(new_boxes.shape[0]):
			(x1, y1, x2, y2) = new_boxes[jk, :]
			det = {'x1': x1, 'x2': x2, 'y1': y1, 'y2': y2, 'class': key, 'prob': new_probs[jk]}
			all_dets.append(det)
print('Elapsed time = {}'.format(time.time() - st))
	t, p = get_map(all_dets, img_data['bboxes'], (fx, fy))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant