DINO-DETR

IDEA Research가 DINO라는 이름으로 발표한 DINO-DETR은 Deformable DETR의 희소 어텐션 위에 대조적 노이즈 제거 학습과 혼합 쿼리 선택을 결합합니다. LibreYOLO는 탐지용으로 세 가지 크기를 제공하며 추론만 지원합니다.

작업
detection
크기
r50, r50s5, swinl at 800 px
설치
pip install libreyolo
지원 티어
추론 전용, v부터 지원. 예측, 검증, 내보내기만 지원합니다. 학습 기능은 적용되지 않습니다.
업스트림
IDEA Research의 DINO-DETR, Apache-2.0. 논문, 소스
라이선스
코드 Apache-2.0, 가중치 Apache-2.0. 상업적 사용

설치

DINO-DETR에는 선택적 extra가 필요하지 않습니다. LibreYOLO의 Deformable DETR 계열과 같은 순수 PyTorch 다중 스케일 deformable attention 코어를 사용하며 가져오는 모든 항목이 기본 설치에 포함됩니다.

bash
pip install libreyolo

libreyolo[hub-kernels] 설치는 선택 사항입니다. kernels 패키지가 있으면 LibreYOLO는 런타임에 Hugging Face Hub에서 컴파일된 다중 스케일 deformable attention 커널을 가져와 순수 PyTorch 코어 대신 사용합니다. LIBREYOLO_HUB_KERNELS=0으로 다시 비활성화할 수 있습니다.

예측

처음 사용할 때 Hugging Face에서 가중치를 다운로드해 로컬에 캐시합니다.

Python
from libreyolo import LibreYOLO, SAMPLE_IMAGE model = LibreYOLO("LibreDINODETRr50.pt")result = model(SAMPLE_IMAGE, save=True) for box in result.boxes:    print(box.cls, box.conf, box.xyxy)
CLI
libreyolo predict model=LibreDINODETRr50.pt source=https://raw.githubusercontent.com/LibreYOLO/libreyolo/release/libreyolo/assets/parkour.jpg save=True

반환되는 Results 객체는 모든 계열이 반환하는 것과 같으므로 탐지기를 바꾸려면 한 줄만 변경하면 됩니다. confmax_det은 쿼리 선택을 필터링합니다. 디코더가 NMS 단계 없는 집합 예측기이므로 iou는 API 일관성을 위해 허용되지만 아무 효과가 없습니다. 소스, 스트리밍, 결과 처리는 예측을 참조합니다.

LibreYOLO에서 DINO-DETR은 추론 전용입니다. 업스트림은 대조적 노이즈 제거와 헝가리안 매칭으로 학습하지만 해당 레시피는 여기 구현되지 않았으므로 train()NotImplementedError를 발생시킵니다.

변형

세 체크포인트는 모두 같은 입력 해상도를 사용합니다. r50r50s5는 ResNet-50 백본을 공유하지만 디코더에 공급되는 특징 맵 스케일이 각각 네 개와 다섯 개로 다릅니다. swinl은 백본을 Swin-L로 교체하고 스케일도 다섯 개 샘플링합니다.

검증

val()은 학습에 사용한 형식의 데이터셋을 대상으로 측정한 정밀도, 재현율, mAP 50, mAP 50-95를 포함하는 metrics/ 키 사전을 반환합니다.

Python
from libreyolo import LibreYOLO model = LibreYOLO("LibreDINODETRr50.pt") # val()은 객체가 아닌 일반 dict를 반환합니다.metrics = model.val(data="my-dataset.yaml") print(metrics["metrics/mAP50-95"])print(metrics["metrics/mAP50"])print(metrics["metrics/precision"], metrics["metrics/recall"])
CLI
libreyolo val model=LibreDINODETRr50.pt data=my-dataset.yaml

내보내기

작업ONNXTorchScriptExecuTorchTensorRTOpenVINOPaddleMNNRKNNncnnTFLiteCoreMLCore AI
DetectionDetection to ONNX: 지원함Detection to TorchScript: 지원함Detection to ExecuTorch: 지원함Detection to TensorRT: 지원함Detection to OpenVINO: 지원함Detection to Paddle: 지원하지 않음Detection to MNN: 지원하지 않음Detection to RKNN: 지원하지 않음Detection to ncnn: 지원하지 않음Detection to TFLite: 지원하지 않음Detection to CoreML: 지원하지 않음Detection to Core AI: 지원하지 않음

내보낸 아티팩트는 파일 접미사에 따라 LibreYOLO()로 다시 불러옵니다. 따라서 .onnx 또는 .engine 파일은 체크포인트처럼 동작하며 동일한 Results를 반환합니다. 각 형식이 받는 인수는 내보내기에 나와 있습니다.

Python
from libreyolo import LibreYOLO model = LibreYOLO("LibreDINODETRr50.pt")model.export(format="onnx", imgsz=800)model.export(format="tensorrt", imgsz=800, half=True)
CLI
libreyolo export model=LibreDINODETRr50.pt format=onnx imgsz=800libreyolo export model=LibreDINODETRr50.pt format=tensorrt imgsz=800 half=True
내보낸 파일 사용
from libreyolo import LibreYOLO, SAMPLE_IMAGE # 팩토리는 파일 접미사에 따라 라우팅하므로 내보낸 아티팩트도# 다른 체크포인트처럼 불러와 동일한 Results 객체를 반환합니다.model = LibreYOLO("LibreDINODETRr50.onnx")result = model(SAMPLE_IMAGE) print(result.boxes.xyxy)

체크포인트

이 계열에 공개된 모든 가중치 파일입니다.

파일입력(px)가중치 라이선스
Detection
LibreDINODETRr50.pt800apache-2.0
LibreDINODETRr50s5.pt800apache-2.0
LibreDINODETRswinl.pt800apache-2.0

위의 모든 파일은 현재 LibreYOLO 조직에 있으며 처음 사용할 때 내려받습니다.

라이선스

내려받는 특정 가중치의 Hugging Face 저장소에서 라이선스를 확인하십시오. LibreYOLO 조직의 모든 체크포인트에는 라이선스가 있으며 한 계열 안에서도 항상 같지는 않습니다. 해당 저장소가 신뢰할 수 있는 기준입니다. 아래 요약은 이 페이지를 마지막으로 검증했을 때 적용된 내용을 설명합니다.

관련 라이선스에 관한 설명이며 법률 자문이 아닙니다. 상업적으로 중요한 사안이라면 라이선스를 직접 읽고 별도의 법률 자문을 받으십시오.

원작
DINO-DETR, IDEA Research
업스트림 라이선스
Apache-2.0
LibreYOLO 코드
MIT
가중치
Apache-2.0, huggingface.co/LibreYOLO에 다시 게시됨
해석
Apache-2.0 is a permissive license, so these weights can be used in commercial and closed-source products. It asks you to keep its license text and attribution notices with any copy of the weights you redistribute, and it grants a patent license. It places no obligation on your own application code, and weights you train yourself on your own data are yours. The three checkpoints come from the authors' Google Drive release rather than a Hugging Face model card, and the upstream repository does not attach a license to the checkpoint files individually, so the redistribution basis is the repository-level Apache-2.0 declaration rather than a checkpoint-specific grant.

공식 체크포인트 세 개는 Hugging Face 모델 카드가 아닌 저자의 Google Drive 릴리스 폴더에서 가져옵니다. 업스트림 저장소는 저장소 수준에서 Apache-2.0을 선언하지만 체크포인트 자체에는 라이선스 파일이나 메타데이터를 첨부하지 않습니다. 따라서 재배포 근거는 체크포인트별 허가가 아니라 저장소 수준 선언입니다. 모든 LibreYOLO 미러는 업스트림 Apache-2.0 라이선스 원문과 이 내용을 설명하는 고지를 함께 제공합니다.

인용

@misc{zhang2022dino,
      title={DINO: DETR with Improved DeNoising Anchor Boxes for End-to-End Object Detection}, 
      author={Hao Zhang and Feng Li and Shilong Liu and Lei Zhang and Hang Su and Jun Zhu and Lionel M. Ni and Heung-Yeung Shum},
      year={2022},
      eprint={2203.03605},
      archivePrefix={arXiv},
      primaryClass={cs.CV}
}

@inproceedings{li2022dn,
      title={Dn-detr: Accelerate detr training by introducing query denoising},
      author={Li, Feng and Zhang, Hao and Liu, Shilong and Guo, Jian and Ni, Lionel M and Zhang, Lei},
      booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
      pages={13619--13627},
      year={2022}
}

@inproceedings{
      liu2022dabdetr,
      title={{DAB}-{DETR}: Dynamic Anchor Boxes are Better Queries for {DETR}},
      author={Shilong Liu and Feng Li and Hao Zhang and Xiao Yang and Xianbiao Qi and Hang Su and Jun Zhu and Lei Zhang},
      booktitle={International Conference on Learning Representations},
      year={2022},
      url={https://openreview.net/forum?id=oMI9PjOb9Jl}
}

github.com/IDEA-Research/DINO#bibtex에 있는 저자의 인용 블록에서 복사했습니다.

LibreYOLO v1.5.0에서 검증되었습니다. 이 페이지의 지원 표, 체크포인트, 벤치마크 수치는 출시된 라이브러리와 공개된 가중치에서 생성되며 수동으로 작성되지 않습니다.