objectscope.utils ================= .. py:module:: objectscope.utils Functions --------- .. autoapisummary:: objectscope.utils.launch_tensorboard objectscope.utils.run_optimize_model objectscope.utils.compute_statistics objectscope.utils.predict_bbox objectscope.utils.draw_bbox_and_polygons objectscope.utils.save_class_metadata Module Contents --------------- .. py:function:: launch_tensorboard(logdir, port_num=None) .. py:function:: run_optimize_model(model_name_or_path, output_dir, device='cpu', provider='CPUExecutionProvider', precision='int4') .. py:function:: compute_statistics(img_paths: list) .. py:function:: predict_bbox(image, model_path) .. py:function:: draw_bbox_and_polygons(image, bboxes, scores, class_names=None, score_thresh=0.3, polygons=None) -> PIL.Image Visualize the bbox(es) and segmentation mask(s) of objects in image(s) :param image: PIL Image to draw bbox and segmentation on. :type image: Image :param bboxes: List of boundary boxes. :type bboxes: List :param scores: Confidence score to use for filtering and drawing on image. :type scores: List :param class_names: Name(s) of objects for each bbox and polygon. :type class_names: List :param score_thresh: Threshold to filter out low-confidence detections. Defaults to 0.3. :type score_thresh: float, optional :param polygons: List of segmentation masks. Defaults to None. :type polygons: List, optional Returns: PIL Image with drawn bbox and segmentation mask. .. py:function:: save_class_metadata(train_data_name, save_metadata_as)