tensorflow-yolov4-tflite icon indicating copy to clipboard operation
tensorflow-yolov4-tflite copied to clipboard

Representative dataset file format

Open rossGardiner opened this issue 4 years ago • 1 comments

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.

rossGardiner avatar Aug 13 '21 11:08 rossGardiner

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

lukqw avatar Oct 27 '21 20:10 lukqw