본문으로 건너뛰기

Calculate mAP

Save dataset for mAP

Downloads

Script

  • 2021-02-21
  • OS: Ubuntu 20.04
  • TF: v2.4.1
  • yolov4: v3.1.0
from yolov4.tf import YOLOv4, YOLODataset, create_mAP_input_files


yolo = YOLOv4()
yolo.config.parse_names("coco.names")
yolo.config.parse_cfg("yolov4-tiny.cfg")

yolo.make_model()
yolo.load_weights("/home/hhk7734/NN/yolov4-tiny.weights", weights_type="yolo")

dataset = YOLODataset(
config=yolo.config,
dataset_list="/home/hhk7734/NN/val2017.txt",
image_path_prefix="/home/hhk7734/NN/val2017",
training=False,
)

create_mAP_input_files(yolo, mAP_path="/home/hhk7734/mAP", dataset=dataset)
  • @param yolo
  • @parma dataset
  • @param mAP_path
  • @parma images_optional: If True, images are copied to the mAP_path.
  • @param num_sample: Number of images for mAP. If None, all images in dataset are used.

Calculate mAP

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