easydetect 0.2.3__tar.gz → 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. {easydetect-0.2.3 → easydetect-0.3.0}/PKG-INFO +1 -1
  2. {easydetect-0.2.3 → easydetect-0.3.0}/easydetect/__init__.py +1 -1
  3. {easydetect-0.2.3 → easydetect-0.3.0}/easydetect/cli.py +1 -1
  4. {easydetect-0.2.3 → easydetect-0.3.0}/easydetect/model.py +11 -9
  5. {easydetect-0.2.3 → easydetect-0.3.0}/easydetect/predictor.py +8 -2
  6. {easydetect-0.2.3 → easydetect-0.3.0}/pyproject.toml +1 -1
  7. {easydetect-0.2.3 → easydetect-0.3.0}/tests/test_predictor.py +12 -0
  8. {easydetect-0.2.3 → easydetect-0.3.0}/tools/hub_README.md +1 -1
  9. {easydetect-0.2.3 → easydetect-0.3.0}/.gitignore +0 -0
  10. {easydetect-0.2.3 → easydetect-0.3.0}/LICENSE +0 -0
  11. {easydetect-0.2.3 → easydetect-0.3.0}/NOTICE +0 -0
  12. {easydetect-0.2.3 → easydetect-0.3.0}/README.md +0 -0
  13. {easydetect-0.2.3 → easydetect-0.3.0}/easydetect/data/__init__.py +0 -0
  14. {easydetect-0.2.3 → easydetect-0.3.0}/easydetect/data/augment.py +0 -0
  15. {easydetect-0.2.3 → easydetect-0.3.0}/easydetect/data/dataset.py +0 -0
  16. {easydetect-0.2.3 → easydetect-0.3.0}/easydetect/data/labels.py +0 -0
  17. {easydetect-0.2.3 → easydetect-0.3.0}/easydetect/downloads.py +0 -0
  18. {easydetect-0.2.3 → easydetect-0.3.0}/easydetect/errors.py +0 -0
  19. {easydetect-0.2.3 → easydetect-0.3.0}/easydetect/exporter.py +0 -0
  20. {easydetect-0.2.3 → easydetect-0.3.0}/easydetect/metrics.py +0 -0
  21. {easydetect-0.2.3 → easydetect-0.3.0}/easydetect/nn/__init__.py +0 -0
  22. {easydetect-0.2.3 → easydetect-0.3.0}/easydetect/nn/decoder.py +0 -0
  23. {easydetect-0.2.3 → easydetect-0.3.0}/easydetect/nn/denoising.py +0 -0
  24. {easydetect-0.2.3 → easydetect-0.3.0}/easydetect/nn/dfine_net.py +0 -0
  25. {easydetect-0.2.3 → easydetect-0.3.0}/easydetect/nn/encoder.py +0 -0
  26. {easydetect-0.2.3 → easydetect-0.3.0}/easydetect/nn/hgnetv2.py +0 -0
  27. {easydetect-0.2.3 → easydetect-0.3.0}/easydetect/nn/ops.py +0 -0
  28. {easydetect-0.2.3 → easydetect-0.3.0}/easydetect/plotting.py +0 -0
  29. {easydetect-0.2.3 → easydetect-0.3.0}/easydetect/results.py +0 -0
  30. {easydetect-0.2.3 → easydetect-0.3.0}/easydetect/sources.py +0 -0
  31. {easydetect-0.2.3 → easydetect-0.3.0}/easydetect/tracker.py +0 -0
  32. {easydetect-0.2.3 → easydetect-0.3.0}/easydetect/trainer.py +0 -0
  33. {easydetect-0.2.3 → easydetect-0.3.0}/easydetect/utils/__init__.py +0 -0
  34. {easydetect-0.2.3 → easydetect-0.3.0}/easydetect/utils/loss.py +0 -0
  35. {easydetect-0.2.3 → easydetect-0.3.0}/easydetect/utils/ops.py +0 -0
  36. {easydetect-0.2.3 → easydetect-0.3.0}/easydetect/validator.py +0 -0
  37. {easydetect-0.2.3 → easydetect-0.3.0}/tests/__init__.py +0 -0
  38. {easydetect-0.2.3 → easydetect-0.3.0}/tests/conftest.py +0 -0
  39. {easydetect-0.2.3 → easydetect-0.3.0}/tests/test_augment.py +0 -0
  40. {easydetect-0.2.3 → easydetect-0.3.0}/tests/test_cli.py +0 -0
  41. {easydetect-0.2.3 → easydetect-0.3.0}/tests/test_coco2yolo.py +0 -0
  42. {easydetect-0.2.3 → easydetect-0.3.0}/tests/test_dataset.py +0 -0
  43. {easydetect-0.2.3 → easydetect-0.3.0}/tests/test_downloads.py +0 -0
  44. {easydetect-0.2.3 → easydetect-0.3.0}/tests/test_lab_api.py +0 -0
  45. {easydetect-0.2.3 → easydetect-0.3.0}/tests/test_model.py +0 -0
  46. {easydetect-0.2.3 → easydetect-0.3.0}/tests/test_nn.py +0 -0
  47. {easydetect-0.2.3 → easydetect-0.3.0}/tests/test_onnxruntime.py +0 -0
  48. {easydetect-0.2.3 → easydetect-0.3.0}/tests/test_results.py +0 -0
  49. {easydetect-0.2.3 → easydetect-0.3.0}/tests/test_sources.py +0 -0
  50. {easydetect-0.2.3 → easydetect-0.3.0}/tests/test_tracker.py +0 -0
  51. {easydetect-0.2.3 → easydetect-0.3.0}/tests/test_train_export.py +0 -0
  52. {easydetect-0.2.3 → easydetect-0.3.0}/tools/bench.py +0 -0
  53. {easydetect-0.2.3 → easydetect-0.3.0}/tools/build_mirror.py +0 -0
  54. {easydetect-0.2.3 → easydetect-0.3.0}/tools/coco2yolo.py +0 -0
  55. {easydetect-0.2.3 → easydetect-0.3.0}/tools/compare_yolo.py +0 -0
  56. {easydetect-0.2.3 → easydetect-0.3.0}/tools/convert_dfine.py +0 -0
  57. {easydetect-0.2.3 → easydetect-0.3.0}/tools/make_demo.py +0 -0
  58. {easydetect-0.2.3 → easydetect-0.3.0}/tools/make_toyset.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: easydetect
3
- Version: 0.2.3
3
+ Version: 0.3.0
4
4
  Summary: Easy real-time object detection you can ship: D-FINE with PyTorch training, OpenVINO inference on CPU/GPU/NPU, and a browser app to label and train. Apache-2.0 throughout.
5
5
  Project-URL: Homepage, https://github.com/themakerrobot/easydetect
6
6
  Project-URL: Source, https://github.com/themakerrobot/easydetect
@@ -24,7 +24,7 @@ needs numpy/opencv/openvino/pyyaml; training adds
24
24
 
25
25
  from __future__ import annotations
26
26
 
27
- __version__ = "0.2.3"
27
+ __version__ = "0.3.0"
28
28
 
29
29
  from .errors import DownloadError, EasyDetectError, ModelNotFoundError
30
30
  from .metrics import BoxMetrics, DetMetrics
@@ -28,7 +28,7 @@ Modes:
28
28
 
29
29
  Common keys:
30
30
  model=dfine-n|s|m|l|x|best.pt|model.xml source=bus.jpg|dir|video.mp4|0|url
31
- data=data.yaml epochs=100 imgsz=640 batch=8 conf=0.25 iou=0.7|none device=0|cpu|AUTO
31
+ data=data.yaml epochs=100 imgsz=640 batch=8 conf=0.5 iou=0.7|none device=0|cpu|AUTO
32
32
  contain=0.8 project=runs name=predict save=true show=false format=openvino half=true
33
33
 
34
34
  Examples:
@@ -114,7 +114,7 @@ class Detector:
114
114
  def predict(
115
115
  self,
116
116
  source: Any = None,
117
- conf: float = 0.25,
117
+ conf: float = 0.5,
118
118
  imgsz: int | None = None,
119
119
  device: str | None = None,
120
120
  max_det: int = 300,
@@ -134,12 +134,14 @@ class Detector:
134
134
  """Run detection on any supported source.
135
135
 
136
136
  Returns a ``list[Results]``, or a generator when ``stream=True`` (the
137
- only sane option for a long video or a live camera). ``iou`` drops a
138
- box covering a higher-scoring one by more than that IoU — the same
139
- object found twice, sometimes under two classes; ``None`` keeps all.
140
- ``contain=0.8`` also merges a box with 80% of its area inside another
141
- of its class — the visible pieces of a half hidden object reported
142
- beside the whole of it — into one box. Off by default.
137
+ only sane option for a long video or a live camera). ``conf=0.5``
138
+ is where D-FINE's boxes are mostly right (70% on COCO, against 32% at
139
+ YOLO's usual 0.25). ``iou`` drops a box covering a higher-scoring one
140
+ by more than that IoU — the same object found twice, sometimes under
141
+ two classes; ``None`` keeps all. ``contain=0.8`` also merges a box
142
+ with 80% of its area inside another of its class — the visible pieces
143
+ of a half hidden object beside the whole of it — into one box; off by
144
+ default, as on COCO it removes more real objects than it fixes.
143
145
  """
144
146
  if source is None:
145
147
  raise ValueError("predict() needs a source (image, folder, video, url, camera index)")
@@ -171,7 +173,7 @@ class Detector:
171
173
  def track(
172
174
  self,
173
175
  source: Any = None,
174
- conf: float = 0.25,
176
+ conf: float = 0.5,
175
177
  iou: float | None = 0.7,
176
178
  contain: float | None = None,
177
179
  match_iou: float = 0.3,
@@ -209,7 +211,7 @@ class Detector:
209
211
  def _run(
210
212
  self,
211
213
  source: Any,
212
- conf: float = 0.25,
214
+ conf: float = 0.5,
213
215
  imgsz: int | None = None,
214
216
  device: str | None = None,
215
217
  max_det: int = 300,
@@ -128,6 +128,12 @@ def read_names(model_path: Path) -> dict[int, str]:
128
128
  #: Default for ``iou``: above this IoU, two boxes are one object.
129
129
  IOU = 0.7
130
130
 
131
+ #: Default for ``conf``. D-FINE gives an unsure box 0.3-0.5 where YOLO would
132
+ #: give it under 0.25, so YOLO's 0.25 shows mostly mistakes here: dfine-m on
133
+ #: COCO val2017 (NMS 0.7) shows boxes 32% right at 0.25, 70% at 0.5, while
134
+ #: still finding 67% of the objects. See docs/performance.md.
135
+ CONF = 0.5
136
+
131
137
 
132
138
  def drop_duplicates(xyxy: np.ndarray, iou: float = IOU) -> np.ndarray:
133
139
  """Indices of the boxes to keep, from boxes sorted best first.
@@ -277,7 +283,7 @@ class Predictor:
277
283
  boxes: np.ndarray,
278
284
  scores: np.ndarray,
279
285
  orig_shape: tuple[int, int],
280
- conf: float = 0.25,
286
+ conf: float = CONF,
281
287
  max_det: int = 300,
282
288
  classes: list[int] | None = None,
283
289
  iou: float | None = IOU,
@@ -322,7 +328,7 @@ class Predictor:
322
328
  def __call__(
323
329
  self,
324
330
  img: np.ndarray,
325
- conf: float = 0.25,
331
+ conf: float = CONF,
326
332
  max_det: int = 300,
327
333
  classes: list[int] | None = None,
328
334
  iou: float | None = IOU,
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "easydetect"
7
- version = "0.2.3"
7
+ version = "0.3.0"
8
8
  description = "Easy real-time object detection you can ship: D-FINE with PyTorch training, OpenVINO inference on CPU/GPU/NPU, and a browser app to label and train. Apache-2.0 throughout."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -201,3 +201,15 @@ def test_the_whole_path_merges_pieces_only_when_asked():
201
201
  assert sorted(merged[:, 5].tolist()) == [0, 56] # one person, one chair
202
202
  chair = merged[merged[:, 5] == 56][0]
203
203
  assert chair[:4].round().tolist() == [285, 455, 373, 640] # the whole of it
204
+
205
+
206
+ def test_the_defaults_are_the_measured_ones():
207
+ """conf 0.5, NMS 0.7, contain off: docs/performance.md, 'Confidence and overlap defaults'."""
208
+ import inspect
209
+
210
+ from easydetect import Detector
211
+
212
+ for method in (Detector.predict, Detector.track):
213
+ params = inspect.signature(method).parameters
214
+ assert params["conf"].default == 0.5 and params["iou"].default == 0.7
215
+ assert params["contain"].default is None
@@ -29,7 +29,7 @@ pip install easydetect # OpenVINO and ONNX Runtime, no PyTorch
29
29
  from easydetect import Detector
30
30
 
31
31
  model = Detector("dfine-s") # downloads dfine-s/ from this repo once
32
- results = model("photo.jpg", conf=0.25)
32
+ results = model("photo.jpg", conf=0.5)
33
33
  results[0].save("result.jpg")
34
34
 
35
35
  for r in model.predict(0, stream=True, show=True): # webcam; q or Esc quits
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes