MCPcopy
hub / github.com/microsoft/Magma / int_box_area

Function int_box_area

agents/ui_agent/util/utils.py:401–405  ·  view source on GitHub ↗
(box, w, h)

Source from the content-addressed store, hash-verified

399 return boxes, conf, phrases
400
401def int_box_area(box, w, h):
402 x1, y1, x2, y2 = box
403 int_box = [int(x1*w), int(y1*h), int(x2*w), int(y2*h)]
404 area = (int_box[2] - int_box[0]) * (int_box[3] - int_box[1])
405 return area
406
407def get_som_labeled_img(image_source: Union[str, Image.Image], model=None, BOX_TRESHOLD=0.01, output_coord_in_ratio=False, ocr_bbox=None, text_scale=0.4, text_padding=5, draw_bbox_config=None, caption_model_processor=None, ocr_text=[], use_local_semantics=True, iou_threshold=0.9,prompt=None, scale_img=False, imgsz=None, batch_size=64):
408 """Process either an image path or Image object

Callers 1

get_som_labeled_imgFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected