Calculate mAP

Save dataset for mAP

Downloads

Script

from yolov4.tf import YOLOv4
yolo = YOLOv4(tiny=True)
yolo.classes = "coco.names"
yolo.make_model()
yolo.load_weights("yolov4-tiny.weights", weights_type="yolo")
dataset = yolo.load_dataset(
"val2017.txt",
training=False,
image_path_prefix="/home/hhk7734/val2017",
)
yolo.save_dataset_for_mAP("/home/hhk7734/mAP", dataset)
save_dataset_for_mAP(mAP_path, data_set, num_sample=None, images_optional=False)
  • @param mAP_path
  • @parma data_set
  • @param num_sample: Number of images for mAP. If None, all images in data_set are used.
  • @parma images_optional: If True, images are copied to the mAP_path.

Calculate mAP

cd <mAP directory>
python3 -m pip install numpy matplotlib
python3 main.py
  • --no-animation
  • --no-plot
  • --quiet
Last updated on