Skip to content

Commit

Permalink
fix: no calibration datasets bug (#277)
Browse files Browse the repository at this point in the history
  • Loading branch information
mjq2020 authored Jan 16, 2025
1 parent 89716d3 commit 905e586
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tools/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,9 @@ def export_tflite(onnx_path: str, img_shape, img_path):

def representative_dataset():
datasets = [
osp.join(img_path, i) for i in os.listdir(img_path) if i.endswith(".jpg")
osp.join(img_path, i)
for i in os.listdir(img_path)
if i.lower().endswith((".jpg", ".jpeg", ".png"))
]
for ps in tqdm(datasets[:300]):
img = cv2.imread(ps)
Expand Down

0 comments on commit 905e586

Please sign in to comment.