Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions .claude/skills/mblt-vision/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,13 @@ description: >-
the shared instance attribute).
- YOLOX and DAMO-YOLO dispatch on `post_cfg.head` (`yolox` / `damoyolo`) and reuse the
anchorless filter and NMS; only their decode is new (no half-cell offset; DAMO `reg_max: 16`
is 17 bins; DAMO head layout resolved jointly). Both letterbox top-left
(`LetterBox.center: false`, padding 114 / 0), take unscaled input (no Normalize), and YOLOX
reads BGR (`Reader.color_mode`). Shape-only geometry must follow `letterbox_center(pre_cfg)`.
Configs follow mblt-model-ops `jm/temp` `pipeline.yaml`; YAMLs are `local_artifact_only`.
is 17 bins; DAMO head layout resolved jointly). Upstream's test transform is the source of
truth for `pre_cfg`: both letterbox top-left (`LetterBox.center: false`, padding 114 / 0)
with upstream's truncated `int(w * r)` size (`size_rounding: floor`) and take unscaled input
(no Normalize); YOLOX reads cv2 BGR (`Reader.color_mode`) and restores boxes by `/ r`;
DAMO-YOLO reads PIL RGB (`Reader.style: pil`, which COCO evaluation honours through
`CustomCOCODataset(decoder=)`) and restores each axis separately (`per_axis_ratio: true`). Shape-only geometry must follow `letterbox_layout(pre_cfg)`.
`post_cfg` follows mblt-model-ops `jm/temp` `pipeline.yaml`; YAMLs are `local_artifact_only`.
- Rank WiderFace evaluation by Hard-set AP. Expose Medium-set then Easy-set AP
as secondary metrics, and do not compute mean AP across difficulty splits.
- Treat face_detection as a single-class WiderFace task. Each YOLO head family gets a thin
Expand Down
27 changes: 18 additions & 9 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,24 @@ The current ownership boundary is deliberate:
bins -- decoded as the softmax expectation times stride. Neither adds Ultralytics' half-cell
offset. A 640 input's stride-8 DAMO class map is 80x80x80, so the head set's layout (NCHW
or NHWC) is resolved jointly from the unambiguous distribution maps and a mixed set fails.
- Their `pre_cfg` follows mblt-model-ops' `models/<Model>/pipeline.yaml` on branch
`jm/temp` (commit `0368367e8`): YOLOX is BGR (`Reader.color_mode: BGR`), top-left
letterboxed with 114; DAMO-YOLO is RGB, top-left with zeros (the December 2022 checkpoints'
geometry, not upstream HEAD's stretch). Neither declares `Normalize`: both take the
unscaled 0-255 image, and the ONNX path casts the byte tensor to the graph's float dtype.
`LetterBox.center: false` anchors top-left; every place that derives geometry from shapes
alone (`PostBase.ratio_pads_for`, `Results` plotting) must use the model's own
`letterbox_center(pre_cfg)` rather than the centered default. No Hub repository exists
yet, so their YAMLs keep `file_cfg.local_artifact_only: true`.
- Their `pre_cfg` is upstream's own test transform, which is the source of truth (their
`post_cfg` follows mblt-model-ops' `models/<Model>/pipeline.yaml` on branch `jm/temp`,
commit `0368367e8`). YOLOX is `yolox/data/data_augment.py:preproc`: a cv2 BGR image
(`Reader.color_mode: BGR`), resized to `int(w * r) x int(h * r)`, top-left on a 114 canvas,
boxes restored by `/ r`. DAMO-YOLO is the December 2022 release's `Resize` and
`to_image_list` (tinyvision/DAMO-YOLO `55ae14f`; not upstream HEAD's stretch): a PIL RGB
decode (`Reader.style: pil`), the same truncated resize, top-left with zeros, and boxes
restored per axis by `BoxList.resize`. COCO evaluation decodes with the same library as the
model's `Reader` (`CustomCOCODataset(decoder="pil")` for `style: pil`), because the loader
decodes before preprocessing. Hence `LetterBox.size_rounding: floor` on both and
`per_axis_ratio: true` on DAMO-YOLO; tests compare both pipelines pixel-for-pixel with
inlined copies of the upstream code. Neither declares `Normalize`: both take the unscaled
0-255 image, and the ONNX path casts the byte tensor to the graph's float dtype. Every place
that derives geometry from shapes alone (`PostBase.ratio_pads_for`, `Results` plotting,
dense crops, semantic targets) must use the model's own `letterbox_layout(pre_cfg)`
rather than Ultralytics' default. Instance segmentation rejects `size_rounding: floor` and
`per_axis_ratio`, and OBB rejects `per_axis_ratio`, because their restorations cannot honour
them. No Hub repository exists yet, so their YAMLs keep `file_cfg.local_artifact_only: true`.
- For WiderFace evaluation, rank results by Hard-set AP and retain Medium-set
then Easy-set AP as secondary metrics. Do not compute a mean across splits.
- The YOLOv5/YOLOv7 face repositories do not yet publish project-pinned immutable revisions
Expand Down
8 changes: 6 additions & 2 deletions mblt_vision/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -369,8 +369,12 @@ validation split, following Ultralytics' depth-validation convention.
- YOLOX and DAMO-YOLO have no Hub artifact yet, so pass a local `model_path`. Their GPU
scores are the ONNX exports of the upstream checkpoints, measured through this package
(upstream publishes 40.5 for YOLOX-s and 41.8 for DAMO-YOLO-T). Neither preprocesses like
Ultralytics: both letterbox top-left and feed the unscaled 0-255 image, and YOLOX reads
BGR. DAMO-YOLO follows its December 2022 checkpoints, the only ones still downloadable.
Ultralytics: both reproduce upstream's own test transform, which letterboxes top-left with
a truncated `int(w * r)` size (`LetterBox.size_rounding: floor`) and feeds the unscaled
0-255 image. YOLOX reads cv2 BGR and restores boxes by the one resize ratio. DAMO-YOLO
follows its December 2022 checkpoints, the only ones still downloadable: it decodes with
PIL (`Reader.style: pil`) and restores each axis by its own ratio
(`LetterBox.per_axis_ratio: true`).

</details>

Expand Down
2 changes: 1 addition & 1 deletion mblt_vision/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from ._api import list_tasks as list_tasks
from .wrapper import MBLT_Engine as MBLT_Engine

__version__ = "0.0.5"
__version__ = "0.0.6"

_TASK_MODULES = (
face_detection,
Expand Down
19 changes: 12 additions & 7 deletions mblt_vision/models/DAMO-YOLO-M-distill.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
DEFAULT:
# pre_cfg/post_cfg follow mblt-model-ops' DAMO-YOLO-M-distill/pipeline.yaml (branch jm/temp, 0368367e8):
# the downloadable checkpoints are the December 2022 release, whose test
# transform letterboxes RGB with zeros anchored top-left (41.79 mAP50-95 on
# COCO val2017, against 39.72 through upstream HEAD's stretch) and feeds the
# unscaled image -- hence no Normalize. reg_max 16 means 17 distance bins.
# pre_cfg is the test transform of upstream DAMO-YOLO's December 2022 release
# (tinyvision/DAMO-YOLO 55ae14f), the only checkpoints still downloadable: a
# PIL RGB decode, cv2 resized to int(w * r) x int(h * r) -- truncated, hence
# size_rounding: floor -- zero-padded into the top-left corner, and left
# unscaled, hence no Normalize. BoxList.resize restores each axis by its own
# original-over-resized ratio, hence per_axis_ratio. (41.79 mAP50-95 on COCO
# val2017, against 39.72 through upstream HEAD's stretch.) post_cfg follows
# mblt-model-ops' DAMO-YOLO-M-distill/pipeline.yaml (branch jm/temp, 0368367e8);
# reg_max 16 means 17 distance bins.
# No Hub artifact is published yet: pass a local model_path.
file_cfg:
repo_id: mobilint/DAMO-YOLO-M-distill
Expand All @@ -12,14 +16,15 @@ DEFAULT:
local_artifact_only: true
pre_cfg:
Reader:
style: numpy
color_mode: RGB
style: pil
LetterBox:
img_size:
- 640
- 640
center: false
padding_value: 0
size_rounding: floor
per_axis_ratio: true
SetOrder:
shape: HWC
post_cfg:
Expand Down
19 changes: 12 additions & 7 deletions mblt_vision/models/DAMO-YOLO-M.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
DEFAULT:
# pre_cfg/post_cfg follow mblt-model-ops' DAMO-YOLO-M/pipeline.yaml (branch jm/temp, 0368367e8):
# the downloadable checkpoints are the December 2022 release, whose test
# transform letterboxes RGB with zeros anchored top-left (41.79 mAP50-95 on
# COCO val2017, against 39.72 through upstream HEAD's stretch) and feeds the
# unscaled image -- hence no Normalize. reg_max 16 means 17 distance bins.
# pre_cfg is the test transform of upstream DAMO-YOLO's December 2022 release
# (tinyvision/DAMO-YOLO 55ae14f), the only checkpoints still downloadable: a
# PIL RGB decode, cv2 resized to int(w * r) x int(h * r) -- truncated, hence
# size_rounding: floor -- zero-padded into the top-left corner, and left
# unscaled, hence no Normalize. BoxList.resize restores each axis by its own
# original-over-resized ratio, hence per_axis_ratio. (41.79 mAP50-95 on COCO
# val2017, against 39.72 through upstream HEAD's stretch.) post_cfg follows
# mblt-model-ops' DAMO-YOLO-M/pipeline.yaml (branch jm/temp, 0368367e8);
# reg_max 16 means 17 distance bins.
# No Hub artifact is published yet: pass a local model_path.
file_cfg:
repo_id: mobilint/DAMO-YOLO-M
Expand All @@ -12,14 +16,15 @@ DEFAULT:
local_artifact_only: true
pre_cfg:
Reader:
style: numpy
color_mode: RGB
style: pil
LetterBox:
img_size:
- 640
- 640
center: false
padding_value: 0
size_rounding: floor
per_axis_ratio: true
SetOrder:
shape: HWC
post_cfg:
Expand Down
19 changes: 12 additions & 7 deletions mblt_vision/models/DAMO-YOLO-S-distill.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
DEFAULT:
# pre_cfg/post_cfg follow mblt-model-ops' DAMO-YOLO-S-distill/pipeline.yaml (branch jm/temp, 0368367e8):
# the downloadable checkpoints are the December 2022 release, whose test
# transform letterboxes RGB with zeros anchored top-left (41.79 mAP50-95 on
# COCO val2017, against 39.72 through upstream HEAD's stretch) and feeds the
# unscaled image -- hence no Normalize. reg_max 16 means 17 distance bins.
# pre_cfg is the test transform of upstream DAMO-YOLO's December 2022 release
# (tinyvision/DAMO-YOLO 55ae14f), the only checkpoints still downloadable: a
# PIL RGB decode, cv2 resized to int(w * r) x int(h * r) -- truncated, hence
# size_rounding: floor -- zero-padded into the top-left corner, and left
# unscaled, hence no Normalize. BoxList.resize restores each axis by its own
# original-over-resized ratio, hence per_axis_ratio. (41.79 mAP50-95 on COCO
# val2017, against 39.72 through upstream HEAD's stretch.) post_cfg follows
# mblt-model-ops' DAMO-YOLO-S-distill/pipeline.yaml (branch jm/temp, 0368367e8);
# reg_max 16 means 17 distance bins.
# No Hub artifact is published yet: pass a local model_path.
file_cfg:
repo_id: mobilint/DAMO-YOLO-S-distill
Expand All @@ -12,14 +16,15 @@ DEFAULT:
local_artifact_only: true
pre_cfg:
Reader:
style: numpy
color_mode: RGB
style: pil
LetterBox:
img_size:
- 640
- 640
center: false
padding_value: 0
size_rounding: floor
per_axis_ratio: true
SetOrder:
shape: HWC
post_cfg:
Expand Down
19 changes: 12 additions & 7 deletions mblt_vision/models/DAMO-YOLO-S.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
DEFAULT:
# pre_cfg/post_cfg follow mblt-model-ops' DAMO-YOLO-S/pipeline.yaml (branch jm/temp, 0368367e8):
# the downloadable checkpoints are the December 2022 release, whose test
# transform letterboxes RGB with zeros anchored top-left (41.79 mAP50-95 on
# COCO val2017, against 39.72 through upstream HEAD's stretch) and feeds the
# unscaled image -- hence no Normalize. reg_max 16 means 17 distance bins.
# pre_cfg is the test transform of upstream DAMO-YOLO's December 2022 release
# (tinyvision/DAMO-YOLO 55ae14f), the only checkpoints still downloadable: a
# PIL RGB decode, cv2 resized to int(w * r) x int(h * r) -- truncated, hence
# size_rounding: floor -- zero-padded into the top-left corner, and left
# unscaled, hence no Normalize. BoxList.resize restores each axis by its own
# original-over-resized ratio, hence per_axis_ratio. (41.79 mAP50-95 on COCO
# val2017, against 39.72 through upstream HEAD's stretch.) post_cfg follows
# mblt-model-ops' DAMO-YOLO-S/pipeline.yaml (branch jm/temp, 0368367e8);
# reg_max 16 means 17 distance bins.
# No Hub artifact is published yet: pass a local model_path.
file_cfg:
repo_id: mobilint/DAMO-YOLO-S
Expand All @@ -12,14 +16,15 @@ DEFAULT:
local_artifact_only: true
pre_cfg:
Reader:
style: numpy
color_mode: RGB
style: pil
LetterBox:
img_size:
- 640
- 640
center: false
padding_value: 0
size_rounding: floor
per_axis_ratio: true
SetOrder:
shape: HWC
post_cfg:
Expand Down
19 changes: 12 additions & 7 deletions mblt_vision/models/DAMO-YOLO-T-distill.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
DEFAULT:
# pre_cfg/post_cfg follow mblt-model-ops' DAMO-YOLO-T-distill/pipeline.yaml (branch jm/temp, 0368367e8):
# the downloadable checkpoints are the December 2022 release, whose test
# transform letterboxes RGB with zeros anchored top-left (41.79 mAP50-95 on
# COCO val2017, against 39.72 through upstream HEAD's stretch) and feeds the
# unscaled image -- hence no Normalize. reg_max 16 means 17 distance bins.
# pre_cfg is the test transform of upstream DAMO-YOLO's December 2022 release
# (tinyvision/DAMO-YOLO 55ae14f), the only checkpoints still downloadable: a
# PIL RGB decode, cv2 resized to int(w * r) x int(h * r) -- truncated, hence
# size_rounding: floor -- zero-padded into the top-left corner, and left
# unscaled, hence no Normalize. BoxList.resize restores each axis by its own
# original-over-resized ratio, hence per_axis_ratio. (41.79 mAP50-95 on COCO
# val2017, against 39.72 through upstream HEAD's stretch.) post_cfg follows
# mblt-model-ops' DAMO-YOLO-T-distill/pipeline.yaml (branch jm/temp, 0368367e8);
# reg_max 16 means 17 distance bins.
# No Hub artifact is published yet: pass a local model_path.
file_cfg:
repo_id: mobilint/DAMO-YOLO-T-distill
Expand All @@ -12,14 +16,15 @@ DEFAULT:
local_artifact_only: true
pre_cfg:
Reader:
style: numpy
color_mode: RGB
style: pil
LetterBox:
img_size:
- 640
- 640
center: false
padding_value: 0
size_rounding: floor
per_axis_ratio: true
SetOrder:
shape: HWC
post_cfg:
Expand Down
19 changes: 12 additions & 7 deletions mblt_vision/models/DAMO-YOLO-T.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
DEFAULT:
# pre_cfg/post_cfg follow mblt-model-ops' DAMO-YOLO-T/pipeline.yaml (branch jm/temp, 0368367e8):
# the downloadable checkpoints are the December 2022 release, whose test
# transform letterboxes RGB with zeros anchored top-left (41.79 mAP50-95 on
# COCO val2017, against 39.72 through upstream HEAD's stretch) and feeds the
# unscaled image -- hence no Normalize. reg_max 16 means 17 distance bins.
# pre_cfg is the test transform of upstream DAMO-YOLO's December 2022 release
# (tinyvision/DAMO-YOLO 55ae14f), the only checkpoints still downloadable: a
# PIL RGB decode, cv2 resized to int(w * r) x int(h * r) -- truncated, hence
# size_rounding: floor -- zero-padded into the top-left corner, and left
# unscaled, hence no Normalize. BoxList.resize restores each axis by its own
# original-over-resized ratio, hence per_axis_ratio. (41.79 mAP50-95 on COCO
# val2017, against 39.72 through upstream HEAD's stretch.) post_cfg follows
# mblt-model-ops' DAMO-YOLO-T/pipeline.yaml (branch jm/temp, 0368367e8);
# reg_max 16 means 17 distance bins.
# No Hub artifact is published yet: pass a local model_path.
file_cfg:
repo_id: mobilint/DAMO-YOLO-T
Expand All @@ -12,14 +16,15 @@ DEFAULT:
local_artifact_only: true
pre_cfg:
Reader:
style: numpy
color_mode: RGB
style: pil
Comment thread
parkjinman98 marked this conversation as resolved.
LetterBox:
img_size:
- 640
- 640
center: false
padding_value: 0
size_rounding: floor
per_axis_ratio: true
SetOrder:
shape: HWC
post_cfg:
Expand Down
10 changes: 7 additions & 3 deletions mblt_vision/models/YOLOX-Darknet53.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
DEFAULT:
# pre_cfg/post_cfg follow mblt-model-ops' YOLOX-Darknet53/pipeline.yaml (branch jm/temp, 0368367e8):
# upstream's ValTransform(legacy=False) feeds a cv2 BGR image, resized onto a
# 114-filled canvas anchored top-left, and left unscaled -- hence no Normalize.
# pre_cfg is upstream YOLOX's own test transform (yolox/data/data_augment.py
# preproc via ValTransform(legacy=False)): a cv2 BGR image resized to
# int(w * r) x int(h * r) -- truncated, hence size_rounding: floor -- onto a
# 114-filled canvas anchored top-left, and left unscaled, hence no Normalize.
# Boxes are restored by dividing by r. post_cfg follows mblt-model-ops'
# YOLOX-Darknet53/pipeline.yaml (branch jm/temp, 0368367e8).
# No Hub artifact is published yet: pass a local model_path.
file_cfg:
repo_id: mobilint/YOLOX-Darknet53
Expand All @@ -18,6 +21,7 @@ DEFAULT:
- 640
center: false
padding_value: 114
size_rounding: floor
SetOrder:
shape: HWC
post_cfg:
Expand Down
10 changes: 7 additions & 3 deletions mblt_vision/models/YOLOX-Nano.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
DEFAULT:
# pre_cfg/post_cfg follow mblt-model-ops' YOLOX-Nano/pipeline.yaml (branch jm/temp, 0368367e8):
# upstream's ValTransform(legacy=False) feeds a cv2 BGR image, resized onto a
# 114-filled canvas anchored top-left, and left unscaled -- hence no Normalize.
# pre_cfg is upstream YOLOX's own test transform (yolox/data/data_augment.py
# preproc via ValTransform(legacy=False)): a cv2 BGR image resized to
# int(w * r) x int(h * r) -- truncated, hence size_rounding: floor -- onto a
# 114-filled canvas anchored top-left, and left unscaled, hence no Normalize.
# Boxes are restored by dividing by r. post_cfg follows mblt-model-ops'
# YOLOX-Nano/pipeline.yaml (branch jm/temp, 0368367e8).
# No Hub artifact is published yet: pass a local model_path.
file_cfg:
repo_id: mobilint/YOLOX-Nano
Expand All @@ -18,6 +21,7 @@ DEFAULT:
- 416
center: false
padding_value: 114
size_rounding: floor
SetOrder:
shape: HWC
post_cfg:
Expand Down
10 changes: 7 additions & 3 deletions mblt_vision/models/YOLOX-Tiny.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
DEFAULT:
# pre_cfg/post_cfg follow mblt-model-ops' YOLOX-Tiny/pipeline.yaml (branch jm/temp, 0368367e8):
# upstream's ValTransform(legacy=False) feeds a cv2 BGR image, resized onto a
# 114-filled canvas anchored top-left, and left unscaled -- hence no Normalize.
# pre_cfg is upstream YOLOX's own test transform (yolox/data/data_augment.py
# preproc via ValTransform(legacy=False)): a cv2 BGR image resized to
# int(w * r) x int(h * r) -- truncated, hence size_rounding: floor -- onto a
# 114-filled canvas anchored top-left, and left unscaled, hence no Normalize.
# Boxes are restored by dividing by r. post_cfg follows mblt-model-ops'
# YOLOX-Tiny/pipeline.yaml (branch jm/temp, 0368367e8).
# No Hub artifact is published yet: pass a local model_path.
file_cfg:
repo_id: mobilint/YOLOX-Tiny
Expand All @@ -18,6 +21,7 @@ DEFAULT:
- 416
center: false
padding_value: 114
size_rounding: floor
SetOrder:
shape: HWC
post_cfg:
Expand Down
10 changes: 7 additions & 3 deletions mblt_vision/models/YOLOX-l.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
DEFAULT:
# pre_cfg/post_cfg follow mblt-model-ops' YOLOX-l/pipeline.yaml (branch jm/temp, 0368367e8):
# upstream's ValTransform(legacy=False) feeds a cv2 BGR image, resized onto a
# 114-filled canvas anchored top-left, and left unscaled -- hence no Normalize.
# pre_cfg is upstream YOLOX's own test transform (yolox/data/data_augment.py
# preproc via ValTransform(legacy=False)): a cv2 BGR image resized to
# int(w * r) x int(h * r) -- truncated, hence size_rounding: floor -- onto a
# 114-filled canvas anchored top-left, and left unscaled, hence no Normalize.
# Boxes are restored by dividing by r. post_cfg follows mblt-model-ops'
# YOLOX-l/pipeline.yaml (branch jm/temp, 0368367e8).
# No Hub artifact is published yet: pass a local model_path.
file_cfg:
repo_id: mobilint/YOLOX-l
Expand All @@ -18,6 +21,7 @@ DEFAULT:
- 640
center: false
padding_value: 114
size_rounding: floor
SetOrder:
shape: HWC
post_cfg:
Expand Down
Loading
Loading