일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- Carla
- 크롤링
- TensorFlow Object Detection 사용예시
- Paper Analysis
- Git
- 객체 탐지
- InstructPix2Pix
- Docker
- Towards Deep Learning Models Resistant to Adversarial Attacks
- object detection
- CARLA simulator
- Custom Animation
- DACON
- Object Detection Dataset 생성
- DOTA dataset
- 논문분석
- paper review
- Branch 활용 개발
- 기능과 역할
- 리눅스 빌드
- 사회초년생 추천독서
- TensorFlow Object Detection Error
- Linux build
- 개발흐름
- AI Security
- TensorFlow Object Detection Model Build
- VOC 변환
- 논문 분석
- 커스텀 애니메이션 적용
- TensorFlow Object Detection API install
Archives
- Today
- Total
JSP's Deep learning
[Deep learning - Obeject Detection] TensorFlow Object Detection API(2) - 커스텀 데이터 셋 생성 본문
Deap learning/Object Detection
[Deep learning - Obeject Detection] TensorFlow Object Detection API(2) - 커스텀 데이터 셋 생성
_JSP_ 2023. 3. 6. 21:461. Detection 데이터 만들기
1) labelImg를 이용한 이미지 라벨링
진행순서
-
labelImg 실행
-
TensorFlow/addons/labelImg 경로로 이동
-
python labelImg.py [이미지 데이터 경로]
(본문에서는 TensorFlow/workspace/training_demo/images)
-
- 이미지 파일 선택
-
Ctrl + 마우스 클릭으로 bounding box 지정
-
Label 입력 or Default label 지정
- 저장(본문에서는 TensorFlow/workspace/training_demo/images에 저장)
-> 최종적으로 Image에 대한 box 및 label 정보가 .xml 형태로 저장
labelImg 예시
- 실행 결과 및 바운딩 박스 표기
-
labelImg로 생성된 .xml 파일 형태
2. 데이터 분리(학습용 및 테스트용)
Script 파일을 이용한 간단 분리
-
Script 파일 다운로드
- 다운로드 링크 : download
-
Tensorflow/scripts/preprocessing에 저장
-
Tensorflow/scripts/preprocessing 경로로 이동
-
Python partition_dataset.py [-h] [-i IMAGEDIR] [-o OUTPUTDIR] [-r RATIO] [-x] 실행
-
-h : help message 출력 옵션
-
-i IMAGEDIR : image data가 있는 폴더 경로 지정
-
-o OUTPUTDIR : train & test data 를 저장할 폴더 경로 지정
-
-r RATIO : 분할 비율 지정(test data 비율)
-
-x : 저장시 .xml 파일도 함께 저장하도록 지정
-
3. Label Map 생성
Labels와 integer values가 매핑된 Label map을 생성한다.
수기로 파일을 작성하여 TensorFlow/workspace/training_demo/annotations 경로에 예시와 같은 label_map.pbtxt을 저장한다.
- 예시)
4. TensorFlow Records 생성
Script 파일을 이용하여 TFRecords 파일 생성
-
스크립트 다운로드 : Download
-
TensorFlow/scripts/preprocessing 경로에 저장
-
TensorFlow/scripts/preprocessing 경로로 이동
-
python generate_tfrecord.py [-h] [-x XML_DIR] [-l LABELS_PATH] [-o OUTPUT_PATH] [-i IMAGE_DIR] [-c CSV_PATH]
-
-h : help message
-
-x XML_DIR : input .xml 파일 저장 경로
-
-l LABELS_PATH : label map(.pbtxt) 파일 저장 경로
-
-o OUTPUT_PATH : .record 파일 저장할 경로
-
-c CSV_PATH : .csv 파일 저장할 경로
-
참고
[1] https://tensorflow-object-detection-api-tutorial.readthedocs.io/en/latest/training.html
Training Custom Object Detector — TensorFlow 2 Object Detection API tutorial documentation
Whether you are using the TensorFlow CPU or GPU variant: In general, even when compared to the best CPUs, almost any GPU graphics card will yield much faster training and detection speeds. As a matter of fact, when I first started I was running TensorFlow
tensorflow-object-detection-api-tutorial.readthedocs.io
'Deap learning > Object Detection' 카테고리의 다른 글
Comments