YOLO(You Only Look Once) 계열 모델들은 Darknet이라는 경량 C/C++ 기반 프레임워크 위에서 동작하도록 설계되었으며, 의존성·파싱·메모리 오버헤드를 최소화하기 위해 XML이 아닌 단순 텍스트 포맷을 채택했습니다.
- 경량성과 속도
XML 파싱은 정규화된 구조를 유지하기 위해 태그별로 복잡한 처리가 필요하고, 특히 C/C++ 환경에서 외부 XML 라이브러리를 추가로 사용해야 합니다. 반면, YOLO 포맷은 한 줄에[클래스] [x_center] [y_center] [width] [height]
형태로 기록되므로, Darknet의 기본 파일 I/O와sscanf
수준의 간단한 문자열 파싱만으로도 충분합니다. 실제로 XML 기반 파싱은 불필요한 오버헤드가 커서 전체 처리 속도를 크게 저하시킵니다[1]. - 의존성 최소화 및 구현 단순화
Darknet은 추가적인 라이브러리 설치 없이 바로 빌드하여 사용하도록 설계되었습니다. XML 파서를 도입하면 빌드 과정이 복잡해지고, 크로스 플랫폼 호환성 문제가 발생할 수 있습니다. 반면, TXT 포맷은 표준 C 함수만으로 읽고 쓸 수 있어 프레임워크를 가볍고 이식성 높게 유지할 수 있습니다[2]. - 정규화된 좌표 사용으로 전처리 부담 경감
YOLO 학습 방식은 이미지 크기에 대한 상대 좌표(0–1 범위)를 직접 사용하여 모델이 다양한 해상도 이미지를 일관되게 처리하도록 합니다. TXT 파일에 저장된 중심점 및 박스 크기 정보가 이미 정규화되어 있어, 별도의 좌표 변환 과정 없이 바로 네트워크 입력으로 활용할 수 있습니다[3]. 반면 Pasca VOC XML에서는 픽셀 단위의 절대 좌표를 사용하므로, 모델 학습 전에 추가적인 계산 단계가 필요합니다.
이처럼 YOLO는 최소한의 코드·메모리·연산으로 최대한 빠르게 어노테이션을 읽고 쓰기 위해, 경량 TXT 포맷을 채택하고 있습니다. 대용량 데이터셋을 빠르게 로드해야 하는 실시간 객체 탐지 모델의 특성상, XML 방식은 과도한 오버헤드로 작용하기 때문입니다.
출처
[1] XML is really, really slow https://blog.kowalczyk.info/article/935t/xml-is-really-really-slow.html
[2] [Object Detection] Image Annotation Formats – 유진’s 공부로그 https://daebaq27.tistory.com/52
[3] What is the YOLO Darknet TXT Annotation Format? – Roboflow https://roboflow.com/formats/yolo-darknet-txt
[4] How To Convert Pascal VOC XML to YOLO Darknet TXT – Roboflow https://roboflow.com/convert/pascal-voc-xml-to-yolo-darknet-txt
[5] YOLO Object Detection Explained: A Beginner’s Guide | Encord https://encord.com/blog/yolo-object-detection-guide/
[6] yakhyo/yolo2voc: | YOLO to VOC format <> VOC to YOLO … – GitHub https://github.com/yakhyo/yolo2voc
[7] Using YOLO for annotation in CVAT https://www.cvat.ai/resources/blog/yolo
[8] Object Detection Datasets Overview – Ultralytics YOLO Docs https://docs.ultralytics.com/datasets/detect/
[9] How To Convert YOLO Darknet TXT to Pascal VOC XML – Roboflow https://roboflow.com/convert/yolo-darknet-txt-to-pascal-voc-xml
[10] YOLO Algorithm for Object Detection Explained [+Examples] – V7 Labs https://www.v7labs.com/blog/yolo-object-detection
[11] GitHub – joshmoy/object-detection-yolo: A Step-by-Step Guide to Object Detection with the Pascal VOC2012 Dataset and YOLOv5 https://github.com/joshmoy/object-detection-yolo
[12] YOLO Annotation 생성 혹은 라벨링 도구 – 임이지의 블로그 https://overface.tistory.com/628
[13] What format does YOLOv2 txt file data use? – Stack Overflow https://stackoverflow.com/questions/70294167/what-format-does-yolov2-txt-file-data-use
[14] YOLOv8 Annotation Format; Essential Guide https://yolov8.org/yolov8-annotation-format/
[15] Convert PASCAL VOC to YOLO format https://readmedium.com/convert-pascal-voc-to-yolo-format-b7672bcf0cb3
[16] Chapter 04-02 – Understanding YOLO dataset annotation format https://www.youtube.com/watch?v=iNsJ_Jc9aNg
[17] 【目标检测标签转换工具】YOLO 格式与 Pascal VOC XML 格式的互转详解(含完整代码) https://blog.csdn.net/qq_43207259/article/details/147802321
[18] Specific format of annotation · Issue #60 · AlexeyAB/Yolo_mark https://github.com/AlexeyAB/Yolo_mark/issues/60
[19] GitHub – alxandru/pascalVOC2YOLO: Converts a PascalVOC dataset to YOLO format. https://github.com/alxandru/pascalVOC2YOLO
[20] How to convert .txt files to xml for yolo object detection – Stack Overflow https://stackoverflow.com/questions/59817205/how-to-convert-txt-files-to-xml-for-yolo-object-detection
[21] Darknet/YOLO Annotation Tool – dlannotator Demo and Tutorial https://www.youtube.com/watch?v=9eVjPMdQir4
[22] Diffrent Yolo versions Annotation · Issue #3826 – GitHub https://github.com/ultralytics/ultralytics/issues/3826
[23] Convert Custom Dataset of Images and XML files to YOLOv5 format .txt https://discuss.roboflow.com/t/convert-custom-dataset-of-images-and-xml-files-to-yolov5-format-txt/475
[24] Annotating images to train a Darknet/YOLO neural network https://www.youtube.com/watch?v=YysHTJojaEM
[25] Yolo txt to xml format · Issue #155 · experiencor/keras-yolo2 – GitHub https://github.com/experiencor/keras-yolo2/issues/155
[26] UNDERSTANDING https://www.darkowl.com/wp-content/uploads/2022/05/UnderstandingDARKINT.pdf
[27] Making Automatic Annotiation tool https://stackoverflow.com/questions/65658051/making-automatic-annotiation-tool
[28] Auto Annotating a Dataset using Python and YOLOV11 https://www.linkedin.com/pulse/auto-annotating-dataset-using-python-yolov11-kartik-sakhuja-uuocf
[29] DreamDrug – A crowdsourced NER dataset for detecting drugs in darknet markets https://aclanthology.org/2021.wnut-1.17.pdf
[30] A Review of YOLOv12: Attention-Based Enhancements vs. Previous … https://arxiv.org/html/2504.11995v1
[31] Yolov4 Annotation Format for AI | Restackio https://www.restack.io/p/ai-yolov4-answer-annotation-format-cat-ai
[32] DT-YOLO: An Improved Object Detection Algorithm for Key … – MDPI https://www.mdpi.com/1424-8220/25/6/1705
[33] YOLOv5 PyTorch TXT Annotation Format https://roboflow.com/formats/yolov5-pytorch-txt
[34] Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: https://aclanthology.org/2022.naacl-main.412.pdf
[35] A Decade of You Only Look Once (YOLO) for Object Detection – arXiv https://arxiv.org/html/2504.18586v1
[36] I have pascal voc dataset with .xml annotation. I want to convert it to … https://stackoverflow.com/questions/58387639/i-have-pascal-voc-dataset-with-xml-annotation-i-want-to-convert-it-to-dakrnet
[37] How can I convert a Darknet label file to regular x,y,w,h? https://stackoverflow.com/questions/57764459/how-can-i-convert-a-darknet-label-file-to-regular-x-y-w-h
[38] Best Practices for Managing https://assets.bbhub.io/company/sites/40/2020/09/Annotation-Best-Practices-091020-FINAL.pdf
[39] Can I know what kind of dataset annotation for object detection is this? https://www.reddit.com/r/computervision/comments/sa1ia4/can_i_know_what_kind_of_dataset_annotation_for/
[40] what is darknet and why is it needed for YOLO object detection? https://datascience.stackexchange.com/questions/65945/what-is-darknet-and-why-is-it-needed-for-yolo-object-detection
[41] How to Convert Annotations from PASCAL VOC to YOLO Darknet https://blog.roboflow.com/how-to-convert-annotations-from-pascal-voc-to-yolo-darknet/
[42] Accelerating Object Detection with YOLOv4 for Real-Time Applications https://arxiv.org/html/2410.16320v1
[43] Delving into YOLO Object Detection Models – MDPI https://www.mdpi.com/2079-9292/14/8/1624
[44] Darknet Guide https://users.ece.utexas.edu/~gerstl/ece382m_f23/resources/Darknet_guide.pdf
[45] Training a Darknet/YOLO neural network in less than 90 seconds https://www.youtube.com/watch?v=dq8AVWvWn54
[46] Real-time evaluation of object detection models across open world … https://www.sciencedirect.com/science/article/abs/pii/S1568494624006951
[47] A High-Performance Interpretive Approach to http://www.cs.toronto.edu/~aheifets/papers/paper507.pdf
[48] Which is fast to read, .xml, .ini or .txt? [closed] – Stack Overflow https://stackoverflow.com/questions/14737977/which-is-fast-to-read-xml-ini-or-txt
[49] XML Optimization for the Highest Performance https://dzone.com/articles/xml-optimization-for-the-highest-performance
[50] reading strings from large file faster https://stackoverflow.com/questions/34534106/reading-strings-from-large-file-faster
[51] GitHub – isabek/XmlToTxt: ImageNet file xml format to Darknet text format https://github.com/isabek/XmlToTxt
[52] DarkVec: Automatic Analysis of Darknet Trafficwith Word Embeddings https://iris.unito.it/retrieve/e27ce434-d080-2581-e053-d805fe0acbaa/darkvec.pdf
[53] A curated list of awesome C++ (or C) frameworks, libraries … – GitHub https://github.com/fffaraz/awesome-cpp
[54] Performance Enhancement of XML Parsing Using Regression and Parallelism https://www.techscience.com/csse/v48n2/55702/html
[55] Why is the output video too slow in darknet? – Stack Overflow https://stackoverflow.com/questions/55605052/why-is-the-output-video-too-slow-in-darknet
[56] Basic detection is very slow (> 20s) · Issue #1579 · pjreddie/darknet https://github.com/pjreddie/darknet/issues/1579
[57] How to Train YOLOv4 on a Custom Dataset – Roboflow Blog https://blog.roboflow.com/training-yolov4-on-a-custom-dataset/
[58] FPS issue · Issue #25 · leggedrobotics/darknet_ros – GitHub https://github.com/leggedrobotics/darknet_ros/issues/25
[59] YOLOV8 Label Format: Step-by-Step Guide https://yolov8.org/yolov8-label-format/
[60] Why should I make annotations when creating a dataset for YOLO … https://stackoverflow.com/questions/48463049/why-should-i-make-annotations-when-creating-a-dataset-for-yolo-and-ssd-models
[61] [Vision] 엔지니어의 Yolo 도전기(2) – Train Dataset 준비 https://developnote-blog.tistory.com/162
[62] Export to YOLO not working · Issue #78 · ryouchinsa/Rectlabel-support https://github.com/ryouchinsa/Rectlabel-support/issues/78
[63] Is it possible to simplify the sets to speed things up if I only care … https://github.com/pjreddie/darknet/issues/142
답글 남기기