MCPcopy Create free account
hub / github.com/EmbodiedGPT/EmbodiedGPT_Pytorch / glip_show

Method glip_show

demo/script.py:427–441  ·  view source on GitHub ↗
(self,detect_model,image_glip, object_list,view="left")

Source from the content-addressed store, hash-verified

425
426
427 def glip_show(self,detect_model,image_glip, object_list,view="left"):
428 image_glip=cv2.cvtColor(image_glip, cv2.COLOR_BGR2RGB)
429 scores, boxes, names = detect_model.inference_on_image(image_glip, object_list)
430 print(scores, boxes, names)
431 #scores, boxes, names = self.reduce_boxes(scores, boxes, names)
432 #box_dict=self.refine_bbox_dict(boxes, names)
433 # draw output image
434 plt.figure(figsize=(10, 10))
435 # image_rbg = cv2.cvtColor(image_glip, cv2.COLOR_BGR2RGB)
436 plt.imshow(cv2.cvtColor(image_glip, cv2.COLOR_BGR2RGB))
437 show_predictions(scores, boxes, names)
438 plt.axis('off')
439 plt.savefig("./test_glip_"+view+".png",bbox_inches="tight", dpi=300, pad_inches=0.0)
440 # return box_dict
441 return None
442
443 @torch.no_grad()
444 def ask_question(self,input_imgs,detect_model):

Callers 1

ask_questionMethod · 0.95

Calls 1

show_predictionsFunction · 0.85

Tested by

no test coverage detected