Upload 2 files
Browse files- miner.py +17 -1
- weights.onnx +2 -2
miner.py
CHANGED
|
@@ -30,7 +30,7 @@ class Miner:
|
|
| 30 |
model_class_names = ["bottle", "can", "cup"]
|
| 31 |
_model_to_competition_cls = np.array([1, 2, 0], dtype=np.int32)
|
| 32 |
input_size = 1280
|
| 33 |
-
iou_thres = 0.
|
| 34 |
cross_iou_thresh = 0.7
|
| 35 |
min_side = 8.0
|
| 36 |
min_box_area = 100.0
|
|
@@ -526,3 +526,19 @@ class Miner:
|
|
| 526 |
)
|
| 527 |
)
|
| 528 |
return results
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
model_class_names = ["bottle", "can", "cup"]
|
| 31 |
_model_to_competition_cls = np.array([1, 2, 0], dtype=np.int32)
|
| 32 |
input_size = 1280
|
| 33 |
+
iou_thres = 0.3
|
| 34 |
cross_iou_thresh = 0.7
|
| 35 |
min_side = 8.0
|
| 36 |
min_box_area = 100.0
|
|
|
|
| 526 |
)
|
| 527 |
)
|
| 528 |
return results
|
| 529 |
+
|
| 530 |
+
# if __name__ == "__main__":
|
| 531 |
+
|
| 532 |
+
# # predict batch with local images for testing
|
| 533 |
+
# import json
|
| 534 |
+
# from time import time
|
| 535 |
+
|
| 536 |
+
# test_images = [
|
| 537 |
+
# cv2.imread(str(p)) for p in sorted(Path("test_images").glob("*.jpg"))
|
| 538 |
+
# ]
|
| 539 |
+
# miner = Miner(Path("hf_repo"))
|
| 540 |
+
# start_time = time()
|
| 541 |
+
# results = miner.predict_batch(test_images, offset=0, n_keypoints=0)
|
| 542 |
+
# end_time = time()
|
| 543 |
+
# print(f"Predicted {len(test_images)} images in {end_time - start_time:.2f} seconds")
|
| 544 |
+
# print(json.dumps([r.dict() for r in results], indent=2))
|
weights.onnx
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e34c250d8bd2c1a4f05bdb58d1153ff5a3713d30c094ff10be682740ec85c8b1
|
| 3 |
+
size 19358782
|