Skip to content

Instantly share code, notes, and snippets.

View mlnewbie1996's full-sized avatar

Anindya Ghosal mlnewbie1996

View GitHub Profile
@mlnewbie1996
mlnewbie1996 / draw_bounding_box_open_cv.py
Created December 25, 2021 10:00 — forked from kodekracker/draw_bounding_box_open_cv.py
To draw Bounding Box in a image using OpenCV python module
#!/usr/bin/env python
import cv2
import sys
def drawBoundingBoxes(imageData, imageOutputPath, inferenceResults, color):
"""Draw bounding boxes on an image.
imageData: image data in numpy array format
imageOutputPath: output image file path
inferenceResults: inference results array off object (l,t,w,h)
colorMap: Bounding box color candidates, list of RGB tuples.
@mlnewbie1996
mlnewbie1996 / calculate_mean_ap.py
Created December 21, 2021 02:51 — forked from tarlen5/calculate_mean_ap.py
Calculate mean Average Precision (mAP) for a set of ground truth and predicted bounding boxes for a set of images.
"""
author: Timothy C. Arlen
date: 28 Feb 2018
Calculate Mean Average Precision (mAP) for a set of bounding boxes corresponding to specific
image Ids. Usage:
> python calculate_mean_ap.py
Will display a plot of precision vs recall curves at 10 distinct IoU thresholds as well as output