hunglc007 / tensorflow-yolov4-tflite

YOLOv4, YOLOv4-tiny, YOLOv3, YOLOv3-tiny Implemented in Tensorflow 2.0, Android. Convert YOLO v4 .weights tensorflow, tensorrt and tflite
https://github.com/hunglc007/tensorflow-yolov4-tflite
MIT License
2.23k stars 1.24k forks source link

Representative dataset file format #387

Open rossGardiner opened 3 years ago

rossGardiner commented 3 years ago

Is there any information on the representative dataset file format. In this repo, an example is under data/dataset/val2017.txt.

Why are bounding boxes included? I thought only images required to quantize activations. Also, is there info on the bounding box format? MSCOCO format is x, y, w, h. Is it in YOLO format instead?

Many thanks.

lukqw commented 2 years ago

from the code within this repo:

def representative_data_gen():
  fimage = open(FLAGS.dataset).read().split()
  for input_value in range(10):
    if os.path.exists(fimage[input_value]):
      original_image=cv2.imread(fimage[input_value])
      original_image = cv2.cvtColor(original_image, cv2.COLOR_BGR2RGB)
      image_data = utils.image_preprocess(np.copy(original_image), [FLAGS.input_size, FLAGS.input_size])
      img_in = image_data[np.newaxis, ...].astype(np.float32)
      print("calibration image {}".format(fimage[input_value]))
      yield [img_in]
    else:
      continue

seems to me that it's just yielding the images from whatever directory is in the dataset

you can find more info here