tensorflow-yolov4-tflite
tensorflow-yolov4-tflite copied to clipboard
Representative dataset file format
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.
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