cooler8 commited on
Commit
d658572
·
verified ·
1 Parent(s): 81660f7

inferences codes

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +101 -0
  2. README.md +110 -307
  3. WebAPI.py +56 -0
  4. app.log +781 -0
  5. config/.DS_Store +0 -0
  6. config/__pycache__/config.cpython-310.pyc +0 -0
  7. config/__pycache__/config.cpython-35.pyc +0 -0
  8. config/__pycache__/config.cpython-39.pyc +0 -0
  9. config/config.py +48 -0
  10. font/gulim.ttc +3 -0
  11. food_classifier_UI_v099.py +250 -0
  12. food_classifier_yolo.py +279 -0
  13. images_rec/-LcmZOV4xrQVjv61hX2yF.jpeg +3 -0
  14. images_rec/-h6zaExAO5d0SwOLab4CD.txt +3 -0
  15. images_rec/0G5lzNC9wlMjLH4Pgqpiv.txt +3 -0
  16. images_rec/0Wu-eggp4JBICAoABliTc.jpeg +3 -0
  17. images_rec/0xSnz-Yn6dc9yB8eQgzeP.jpeg +3 -0
  18. images_rec/13.jpg +3 -0
  19. images_rec/13118.jpg +0 -0
  20. images_rec/13118_yolo_out_py.jpg +0 -0
  21. images_rec/13121.jpg +3 -0
  22. images_rec/19.jpg +3 -0
  23. images_rec/1cnIS16DmJFYH5xGdZDVp.txt +3 -0
  24. images_rec/1jEP7XVqK_qxMGFELEcBd.txt +3 -0
  25. images_rec/22.jpg +3 -0
  26. images_rec/2ZBNwnbnYNpcLL9aBUS4w.txt +3 -0
  27. images_rec/34gFMj0jKceCkDDHW9H4k.txt +3 -0
  28. images_rec/390XJDGATbmhPazLWOBc6.txt +3 -0
  29. images_rec/3Jkl_BANLxoAJkkWodwKH.txt +3 -0
  30. images_rec/5L7QIIY8EYYhXCyHWUCFr.txt +3 -0
  31. images_rec/7u5qmwKFsB-walZ34Oe4U.txt +3 -0
  32. images_rec/8.jpg +3 -0
  33. images_rec/88rGixQVT8KtfyK_Hq4fH.txt +3 -0
  34. images_rec/8Byi031_J7Dvvrw60jvTf.txt +3 -0
  35. images_rec/911.jpg +0 -0
  36. images_rec/A020112_111114_0004.JPG +3 -0
  37. images_rec/A240208_111424_0032_enhanced.JPG.png +3 -0
  38. images_rec/A240213_111224_0020.JPG +3 -0
  39. images_rec/A250101_111212_0002.JPG +3 -0
  40. images_rec/A250101_111424_0032.JPG +3 -0
  41. images_rec/A260173_111124_0008.JPG +3 -0
  42. images_rec/AisrTDiAbj0Y0w5qGpSp-.txt +3 -0
  43. images_rec/BhzWBe-ZI5ZFgAPzYL23h.txt +3 -0
  44. images_rec/Bk8E-bGn1i4DJIrzKXGW3.txt +3 -0
  45. images_rec/CVuwRcNm-ny33CMmLdIes.txt +3 -0
  46. images_rec/DpBFo_IdI2MzmGFIi4q8b.txt +3 -0
  47. images_rec/E7L6NErhRmI5K7NvwtIIv.txt +3 -0
  48. images_rec/EFcHP3Y89VnQfwzzC12qu.txt +3 -0
  49. images_rec/Ex-6VCTPgtUYyFDCjI8Rp.txt +3 -0
  50. images_rec/F1Bv3_6KeZNbRl2NJZUmu.jpeg +3 -0
.gitattributes CHANGED
@@ -33,3 +33,104 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ font/gulim.ttc filter=lfs diff=lfs merge=lfs -text
37
+ images_rec/-h6zaExAO5d0SwOLab4CD.txt filter=lfs diff=lfs merge=lfs -text
38
+ images_rec/-LcmZOV4xrQVjv61hX2yF.jpeg filter=lfs diff=lfs merge=lfs -text
39
+ images_rec/0G5lzNC9wlMjLH4Pgqpiv.txt filter=lfs diff=lfs merge=lfs -text
40
+ images_rec/0Wu-eggp4JBICAoABliTc.jpeg filter=lfs diff=lfs merge=lfs -text
41
+ images_rec/0xSnz-Yn6dc9yB8eQgzeP.jpeg filter=lfs diff=lfs merge=lfs -text
42
+ images_rec/13.jpg filter=lfs diff=lfs merge=lfs -text
43
+ images_rec/13121.jpg filter=lfs diff=lfs merge=lfs -text
44
+ images_rec/19.jpg filter=lfs diff=lfs merge=lfs -text
45
+ images_rec/1cnIS16DmJFYH5xGdZDVp.txt filter=lfs diff=lfs merge=lfs -text
46
+ images_rec/1jEP7XVqK_qxMGFELEcBd.txt filter=lfs diff=lfs merge=lfs -text
47
+ images_rec/22.jpg filter=lfs diff=lfs merge=lfs -text
48
+ images_rec/2ZBNwnbnYNpcLL9aBUS4w.txt filter=lfs diff=lfs merge=lfs -text
49
+ images_rec/34gFMj0jKceCkDDHW9H4k.txt filter=lfs diff=lfs merge=lfs -text
50
+ images_rec/390XJDGATbmhPazLWOBc6.txt filter=lfs diff=lfs merge=lfs -text
51
+ images_rec/3Jkl_BANLxoAJkkWodwKH.txt filter=lfs diff=lfs merge=lfs -text
52
+ images_rec/5L7QIIY8EYYhXCyHWUCFr.txt filter=lfs diff=lfs merge=lfs -text
53
+ images_rec/7u5qmwKFsB-walZ34Oe4U.txt filter=lfs diff=lfs merge=lfs -text
54
+ images_rec/8.jpg filter=lfs diff=lfs merge=lfs -text
55
+ images_rec/88rGixQVT8KtfyK_Hq4fH.txt filter=lfs diff=lfs merge=lfs -text
56
+ images_rec/8Byi031_J7Dvvrw60jvTf.txt filter=lfs diff=lfs merge=lfs -text
57
+ images_rec/A020112_111114_0004.JPG filter=lfs diff=lfs merge=lfs -text
58
+ images_rec/A240208_111424_0032_enhanced.JPG.png filter=lfs diff=lfs merge=lfs -text
59
+ images_rec/A240213_111224_0020.JPG filter=lfs diff=lfs merge=lfs -text
60
+ images_rec/A250101_111212_0002.JPG filter=lfs diff=lfs merge=lfs -text
61
+ images_rec/A250101_111424_0032.JPG filter=lfs diff=lfs merge=lfs -text
62
+ images_rec/A260173_111124_0008.JPG filter=lfs diff=lfs merge=lfs -text
63
+ images_rec/a4H8DhGz-O-1rU4SwGYQ9.txt filter=lfs diff=lfs merge=lfs -text
64
+ images_rec/AisrTDiAbj0Y0w5qGpSp-.txt filter=lfs diff=lfs merge=lfs -text
65
+ images_rec/BhzWBe-ZI5ZFgAPzYL23h.txt filter=lfs diff=lfs merge=lfs -text
66
+ images_rec/Bk8E-bGn1i4DJIrzKXGW3.txt filter=lfs diff=lfs merge=lfs -text
67
+ images_rec/cspDWHPbvSOYJZKqF9GCO.txt filter=lfs diff=lfs merge=lfs -text
68
+ images_rec/CVuwRcNm-ny33CMmLdIes.txt filter=lfs diff=lfs merge=lfs -text
69
+ images_rec/d9Q6AafXY_FQeHK-445Z1.txt filter=lfs diff=lfs merge=lfs -text
70
+ images_rec/ddTEFkX2ykSaw8bO-6kXF.jpeg filter=lfs diff=lfs merge=lfs -text
71
+ images_rec/DpBFo_IdI2MzmGFIi4q8b.txt filter=lfs diff=lfs merge=lfs -text
72
+ images_rec/E7L6NErhRmI5K7NvwtIIv.txt filter=lfs diff=lfs merge=lfs -text
73
+ images_rec/EFcHP3Y89VnQfwzzC12qu.txt filter=lfs diff=lfs merge=lfs -text
74
+ images_rec/Ex-6VCTPgtUYyFDCjI8Rp.txt filter=lfs diff=lfs merge=lfs -text
75
+ images_rec/F1Bv3_6KeZNbRl2NJZUmu.jpeg filter=lfs diff=lfs merge=lfs -text
76
+ images_rec/F6Pd53sY2kjxRHUUGP0W1.txt filter=lfs diff=lfs merge=lfs -text
77
+ images_rec/f8WRKjYskAIfdAO98AOPB.txt filter=lfs diff=lfs merge=lfs -text
78
+ images_rec/FGwwyukPamfQ4yZG011Qr.txt filter=lfs diff=lfs merge=lfs -text
79
+ images_rec/fjNHe8FUG6vwQ1y1akAt6.txt filter=lfs diff=lfs merge=lfs -text
80
+ images_rec/FtsAHZlrcn07XJB1-751f.txt filter=lfs diff=lfs merge=lfs -text
81
+ images_rec/gcWZJ_7DCZohbRCVFV1Lr.txt filter=lfs diff=lfs merge=lfs -text
82
+ images_rec/gD3Ka3dr1qmZ4iDQer6b-.txt filter=lfs diff=lfs merge=lfs -text
83
+ images_rec/grQmazX8gvt-rcwAQJ_uQ.jpeg filter=lfs diff=lfs merge=lfs -text
84
+ images_rec/gyXEIgTE9e4t3Kcs8kjth.jpeg filter=lfs diff=lfs merge=lfs -text
85
+ images_rec/h6AZi1HMOFE-pLsJVlwJX.txt filter=lfs diff=lfs merge=lfs -text
86
+ images_rec/iBsj7uP1blBfP6hNy5TaM.txt filter=lfs diff=lfs merge=lfs -text
87
+ images_rec/ikC0rxHueYH4BKBr2leuH.txt filter=lfs diff=lfs merge=lfs -text
88
+ images_rec/iKKBzqtYzIpATZWqageI2.txt filter=lfs diff=lfs merge=lfs -text
89
+ images_rec/IZQk15ivk8aMyahzd1Kyd.txt filter=lfs diff=lfs merge=lfs -text
90
+ images_rec/JFwtfnlcbUAbcX3KvVU4Y.txt filter=lfs diff=lfs merge=lfs -text
91
+ images_rec/jR1k9PeNpCDNKtMmzGDj_.txt filter=lfs diff=lfs merge=lfs -text
92
+ images_rec/JX1XdrQyXbmK2pgB1ap2r.txt filter=lfs diff=lfs merge=lfs -text
93
+ images_rec/jxrRHHbhTybq6Rmd33dHv.txt filter=lfs diff=lfs merge=lfs -text
94
+ images_rec/K-sDtES-SUaXTQ2hXQvQv.txt filter=lfs diff=lfs merge=lfs -text
95
+ images_rec/kIyrEuiuij5WJvBUHUH0k.txt filter=lfs diff=lfs merge=lfs -text
96
+ images_rec/kTSKWuiMI7U8VYyoovhjT.txt filter=lfs diff=lfs merge=lfs -text
97
+ images_rec/l39yWZjK6Z2dDio3QFHku.txt filter=lfs diff=lfs merge=lfs -text
98
+ images_rec/l5p0VD2H6MKKpC4oOhFvg.txt filter=lfs diff=lfs merge=lfs -text
99
+ images_rec/Lb4Z_vBgjzV5m28h2iGfd.txt filter=lfs diff=lfs merge=lfs -text
100
+ images_rec/LS42MmzTUMa4yAj3R6Kws.txt filter=lfs diff=lfs merge=lfs -text
101
+ images_rec/m5.jpg filter=lfs diff=lfs merge=lfs -text
102
+ images_rec/Mv7tMmiMXwpfpOAHfAKos.jpeg filter=lfs diff=lfs merge=lfs -text
103
+ images_rec/ndas8VkmE2LkpMNNwk7td.txt filter=lfs diff=lfs merge=lfs -text
104
+ images_rec/NO7tkBlH0ULLFyYwevPS4.txt filter=lfs diff=lfs merge=lfs -text
105
+ images_rec/nRBGhqjYZODA9pfkPu9Pf.jpeg filter=lfs diff=lfs merge=lfs -text
106
+ images_rec/oQc8PyIJpCZmMid3narQ4.txt filter=lfs diff=lfs merge=lfs -text
107
+ images_rec/OR-yQhdketM5-4-TzbBHW.txt filter=lfs diff=lfs merge=lfs -text
108
+ images_rec/png filter=lfs diff=lfs merge=lfs -text
109
+ images_rec/pZGN4fHO5X5TFfzosrimN.txt filter=lfs diff=lfs merge=lfs -text
110
+ images_rec/qcOpuTiz6dfnkL3vT8YfL.jpeg filter=lfs diff=lfs merge=lfs -text
111
+ images_rec/qQwNMS0YNb-edEeStfaUF.txt filter=lfs diff=lfs merge=lfs -text
112
+ images_rec/RhYkF88om2i0HZYgWzyhD.jpeg filter=lfs diff=lfs merge=lfs -text
113
+ images_rec/RmdkMP99cz4at01h4ApMC.txt filter=lfs diff=lfs merge=lfs -text
114
+ images_rec/rNKkY1T8V-QzaKA_Rz-ar.txt filter=lfs diff=lfs merge=lfs -text
115
+ images_rec/rpOll1mVryaUbIJsLRzzF.txt filter=lfs diff=lfs merge=lfs -text
116
+ images_rec/rwbc5u9Ka-jpqUFZcLPon.jpeg filter=lfs diff=lfs merge=lfs -text
117
+ images_rec/rxqZ12JcF-2-9VcNEBaQm.txt filter=lfs diff=lfs merge=lfs -text
118
+ images_rec/sbGE1-K-fD90tEIxu5_4A.jpeg filter=lfs diff=lfs merge=lfs -text
119
+ images_rec/ss2jLfJNaQWLMOh2xE_Df.txt filter=lfs diff=lfs merge=lfs -text
120
+ images_rec/SX_KGixDuhAYXJ1eD8vHz.txt filter=lfs diff=lfs merge=lfs -text
121
+ images_rec/synthetic_fig16.png filter=lfs diff=lfs merge=lfs -text
122
+ images_rec/synthetic_fig8.png filter=lfs diff=lfs merge=lfs -text
123
+ images_rec/TYtVYK5D8zxJ1No-2aOfD.txt filter=lfs diff=lfs merge=lfs -text
124
+ images_rec/W5mZdt_jjiAt-vMCNIpZZ.jpeg filter=lfs diff=lfs merge=lfs -text
125
+ images_rec/wcAM8eTDm07LgUF6VJpY8.jpeg filter=lfs diff=lfs merge=lfs -text
126
+ images_rec/weSZ0_atWQYcLb5bLGh2E.txt filter=lfs diff=lfs merge=lfs -text
127
+ images_rec/Wfp4cQnnxw2qYnSL8gxjD.txt filter=lfs diff=lfs merge=lfs -text
128
+ images_rec/XBYX8LG-n6pVDiM0x1I_3.jpeg filter=lfs diff=lfs merge=lfs -text
129
+ images_rec/y4gH7gyND28OdhTIuSRsY.txt filter=lfs diff=lfs merge=lfs -text
130
+ images_rec/YQPtBbrGcXrTQFBjy_C5O.txt filter=lfs diff=lfs merge=lfs -text
131
+ images_rec/yxfFbbFNd1dW9m2_P74-l.txt filter=lfs diff=lfs merge=lfs -text
132
+ images_rec/YxZBgC2j8OQyuXBReGbPh.txt filter=lfs diff=lfs merge=lfs -text
133
+ images_rec/zMbYKlma7gRQskg_AFl91.txt filter=lfs diff=lfs merge=lfs -text
134
+ yolo/data/food/images/A250101_111424_0032.JPG filter=lfs diff=lfs merge=lfs -text
135
+ yolo/data/food/weights/food-dark-yolov3-tiny_3l-v3-2_24000.weights filter=lfs diff=lfs merge=lfs -text
136
+ yolo/data/food/weights/food-dark-yolov3-tiny_3l-v3-2_last.weights filter=lfs diff=lfs merge=lfs -text
README.md CHANGED
@@ -1,307 +1,110 @@
1
- # AIHub 한국 음식 데이터셋 활용 도구
2
-
3
- **AIHub "건강관리를 위한 음식이미지" 데이터셋을 효율적으로 활용하기 위한 Python 도구 모음**
4
-
5
- [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
6
- [![Python](https://img.shields.io/badge/Python-3.8%2B-blue.svg)](https://www.python.org/)
7
-
8
- ## 📋 개요
9
-
10
- 프로젝트는 [AIHub의 "건강관리를 위한 음식이미지"](https://www.aihub.or.kr/aihubdata/data/view.do?dataSetSn=242) 데이터셋을 활용하기 위한 전처리, 분석, 시각화 도구를 제공합니다.
11
-
12
- ### 🎯 주요 특징
13
-
14
- - **500+ 카테고리** 한국 음식 분류
15
- - **300만장** 고해상도 음식 이미지 처리
16
- - **영양정보** 자동 추정 분석
17
- - **이미지 품질** 자동 검증
18
- - **데 증강** 전처리 파이프라인
19
- - **시각화** 통계 분석 도구
20
-
21
- ## 📊 데이터셋 정보
22
-
23
- | 항목 | 내용 |
24
- |------|------|
25
- | **데이터명** | 건강관리위한 음식|
26
- | **제공기관** | AIHub |
27
- | **데이터 크기** | 300만장 |
28
- | **카테고리** | 500여개 |
29
- | **해상도** | 1,280 x 720 이상 (HD급) |
30
- | **포맷** | JPEG, PNG + JSON 어노테이션 |
31
- | **라이선스** | AIHub 이용약관 준수 |
32
-
33
- ### 🍽️ 주요 카테고리
34
-
35
- - **밥류**: 짬뽕밥, 달걀볶음밥, 누룽지
36
- - **국류**: 된장국, 김치찌개, 순대국
37
- - **류**: 라면, 우동, 파스타
38
- - **육류**: 불고기, 치킨, 족발
39
- - **음료**: 커피, 주스, 차류 등
40
- - **과일/채소**: 사과, 배, 토마토
41
- - **기타**: 빵류, 과자, 견과류 등
42
-
43
- ## 🚀 빠른 시작
44
-
45
- ### 1. 환경
46
-
47
- **Ubuntu24.04(amd64), tf_2.15, python_3.10, CUDA_12.4, and... plz see the requirements.txt**
48
-
49
- ```bash
50
- # 저장소 클론
51
- git clone https://huggingface.co/spaces/speedpointer/Kfoods
52
-
53
- # 가상환경 생성 (권장)
54
- python -m venv venv
55
- source venv/bin/activate # Windows: venv\Scripts\activate
56
-
57
- # 패키지 설치
58
- pip install -r requirements.txt
59
- ```
60
-
61
- ### 2. 데이터 준비
62
-
63
- **⚠️ 중요: 데이터는 AIHub에서 직접 다운로드해야 합니다**
64
-
65
- 1. [AIHub 웹사이트](https://www.aihub.or.kr/aihubdata/data/view.do?dataSetSn=242) 접속
66
- 2. 회원가입 데이터 이용신청
67
- 3. 승인 데이터 다운로드 (약 840GB+)
68
- 4. 압축 해제 후 다음과 같은 구조로 배치:
69
-
70
- ```
71
- /your/data/path/
72
- ├── category1/
73
- │ ├── image1.jpg
74
- │ ├── image2.jpg
75
- │ ├── ...
76
- │ └── annotations.json
77
- ├── category2/
78
- │ ├── image1.jpg
79
- │ ├── ...
80
- └── ...
81
- ```
82
-
83
- ### 3. 기본 사용법
84
-
85
- ```python
86
- from data_loader import KoreanFoodDataLoader
87
- from preprocessing import FoodImagePreprocessor
88
- from category_mapping import KoreanFoodCategoryMapper
89
-
90
- # 데이터 로더 초기화
91
- loader = KoreanFoodDataLoader("/path/to/your/data")
92
-
93
- # 카테고리 목록 확인
94
- categories = loader.get_category_list()
95
- print(f"총 {len(categories)}개 카테고리")
96
-
97
- # 특정 카테고리 이미지 로드
98
- images_data = loader.load_images_from_category("김치찌개", max_images=10)
99
-
100
- # 이미지 전처리
101
- preprocessor = FoodImagePreprocessor(target_size=(224, 224))
102
- for image, metadata in images_data:
103
- processed = preprocessor.preprocess_image(image)
104
- print(f"전처리 완료: {processed.shape}")
105
- ```
106
-
107
- ## 📁 프로젝트 구조
108
-
109
- ```
110
- korean-food-dataset-tools/
111
- ├── data_loader.py # 데이터 로딩 및 관리
112
- ├── category_mapping.py # 카테고리 분류 및 매핑
113
- ├── preprocessing.py # 이미지 전처리 및 증강
114
- ├── example_usage.py # 사용 예제 및 데모
115
- ├── requirements.txt # 필요 패키지 목록
116
- ├── README.md # 프로젝트 설명서
117
- └── examples/ # 추가 예제들
118
- ├── basic_usage.ipynb
119
- ├── training_example.py
120
- └── visualization.py
121
- ```
122
-
123
- ## 🔧 주요 기능
124
-
125
- ### 1. 데이터 로딩 (`data_loader.py`)
126
-
127
- ```python
128
- # 카테고리별 이미지 로드
129
- images = loader.load_images_from_category("불고기", max_images=100)
130
-
131
- # 영양정보 추출
132
- nutrition = loader.get_nutrition_info("김치찌개")
133
-
134
- # 데이터셋 통계
135
- stats = loader.get_data_statistics()
136
- ```
137
-
138
- ### 2. 카테고리 분류 (`category_mapping.py`)
139
-
140
- ```python
141
- mapper = KoreanFoodCategoryMapper()
142
-
143
- # 음식명으로 카테고리 자동 분류
144
- result = mapper.classify_food_name("된장찌개")
145
- print(result) # {'category_id': 1, 'category_name': '밥, 국, 탕, 찌개, 전골', ...}
146
-
147
- # 어노테이션 템플릿 생성
148
- template = mapper.create_annotation_template("FOOD_001", "김치찌개", 1280, 720)
149
- ```
150
-
151
- ### 3. 이미지 전처리 (`preprocessing.py`)
152
-
153
- ```python
154
- preprocessor = FoodImagePreprocessor(target_size=(224, 224))
155
-
156
- # 기본 전처리
157
- processed = preprocessor.preprocess_image(image, augment=False)
158
-
159
- # 데이터 증강 ���용
160
- augmented = preprocessor.preprocess_image(image, augment=True)
161
-
162
- # 이미지 품질 검증
163
- quality = preprocessor.validate_image_quality(image)
164
-
165
- ```
166
-
167
- ### 4. 전체 분석 실행 (`example_usage.py`)
168
-
169
- ```bash
170
- # 데이터 경로 수정 후 실행
171
- python example_usage.py
172
- ```
173
-
174
- 출력 파일:
175
- - `aihub_analysis_results.png`: 데이터 분석 시각화
176
- - `aihub_analysis_report.json`: 상세 분석 보고서
177
-
178
- ## 📈 분석 결과 예시
179
-
180
- ### 카테고리 분포
181
- - 밥류: 45개 (9.0%)
182
- - 국물류: 78개 (15.6%)
183
- - 면류: 32개 (6.4%)
184
- - 육류: 56개 (11.2%)
185
- - 기타: 289개 (57.8%)
186
-
187
- ### 이미지 품질
188
- - 해상도 기준 통과: 95.2%
189
- - 선명도 기준 통과: 88.7%
190
- - 전체 품질 통과: 85.3%
191
-
192
- ## 🤝 활용 사례
193
-
194
- ### 1. 음식 분류 모델 학습
195
-
196
- ```python
197
- # PyTorch 데이터셋 클래스 예시
198
- class KoreanFoodDataset(torch.utils.data.Dataset):
199
- def __init__(self, data_root, transform=None):
200
- self.loader = KoreanFoodDataLoader(data_root)
201
- self.categories = self.loader.get_category_list()
202
- self.transform = transform
203
-
204
- def __getitem__(self, idx):
205
- # 구현 내용
206
- pass
207
- ```
208
-
209
- ### 2. 영양성분 분석 앱
210
-
211
- ```python
212
- # 음식 사진으로부터 영양정보 추정
213
- def analyze_food_nutrition(image_path):
214
- # 이미지 로드 및 전처리
215
- # 모델 추론으로 음식 분류
216
- # 영양정보 반환
217
- pass
218
- ```
219
-
220
- ### 3. 데이터 품질 관리
221
-
222
- ```python
223
- # 대용량 데이터셋의 품질 일괄 검증
224
- def batch_quality_check(data_root):
225
- loader = KoreanFoodDataLoader(data_root)
226
- preprocessor = FoodImagePreprocessor()
227
-
228
- for category in loader.get_category_list():
229
- images_data = loader.load_images_from_category(category)
230
- # 품질 검증 로직
231
- ```
232
-
233
- ## ⚠️ 주의사항
234
-
235
- ### 라이선스 및 사용 제한
236
-
237
- 1. **원본 데이터**: AIHub 이용약관을 반드시 준수해야 합니다
238
- 2. **재배포 금지**: 원본 이미지 데이터를 재배포할 수 없습니다
239
- 3. **상업적 이용**: AIHub 약관에 따른 별도 승인이 필요할 수 있습니다
240
- 4. **인용 필수**: 연구/개발 시 AIHub 데이터셋 출처를 명시해야 합니다
241
-
242
- ### 기술적 요구사항
243
-
244
- - **저장공간**: 최소 2TB 이상 권장
245
- - **메모리**: 8GB RAM 이상 권장
246
- - **GPU**: CUDA 지원 GPU 권장 (선택사항)
247
- - **Python**: 3.10 이상
248
-
249
- ## 🐛 문제 해결
250
-
251
- ### 자주 발생하는 문제
252
-
253
- 1. **메모리 부족**
254
- ```python
255
- # 배치 크기 줄이기
256
- images_data = loader.load_images_from_category(category, max_images=100)
257
- ```
258
-
259
- 2. **CUDA 오류**
260
- ```bash
261
- # CPU 버전 PyTorch 설치
262
- pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu
263
- ```
264
-
265
- 3. **한글 인코딩 문제**
266
- ```python
267
- # 파일 읽기 시 인코딩 명시
268
- with open(file_path, 'r', encoding='utf-8') as f:
269
- data = json.load(f)
270
- ```
271
-
272
- ## 📚 추가 자료
273
-
274
- - [AIHub 공식 문서](https://www.aihub.or.kr)
275
- - [데이터셋 상세 정보](https://www.aihub.or.kr/aihubdata/data/view.do?dataSetSn=242)
276
- - [PyTorch 튜토리얼](https://pytorch.org/tutorials/)
277
- - [Albumentations 문서](https://albumentations.ai/)
278
-
279
- ## 🤝 기여하기
280
-
281
- 1. Fork the Project
282
- 2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
283
- 3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
284
- 4. Push to the Branch (`git push origin feature/AmazingFeature`)
285
- 5. Open a Pull Request
286
-
287
- ## 📝 라이선스
288
-
289
- 이 프로젝트는 Apache 2.0 라이선스 하에 배포됩니다. 자세한 내용은 `LICENSE` 파일을 참조하세요.
290
-
291
- **⚠️ 주의**: 이 도구는 Apache 2.0 라이선스이지만, **AIHub 원본 데이터는 별도의 이용약관**을 따릅니다.
292
-
293
- ## 👥 개발자
294
-
295
- - **메인테이너**: speedpointer (mynameis@hajunho.com)
296
- - **기여자**: [Contributors](https://github.com/speedpointer/Kfoods/contributors)
297
-
298
- ## 📞 문의
299
-
300
- - **이슈**: [GitHub Issues](https://github.com/speedpointer/Kfoods/issues)
301
- - **디스커션**: [GitHub Discussions](https://github.com/speedpointer/Kfoods/discussions)
302
-
303
- ---
304
-
305
- **⭐ 이 프로젝트가 도움이 되었다면 별표를 눌러주세요!**
306
-
307
- Made with ❤️ for Korean AI Community
 
1
+ ## Food Classifier Test Platform for Trained model with PHOTOMATO
2
+ - 마지막 업데이트: 2021/02/21
3
+ - 개발환경: Ubuntu 16.04 (Windows 10) 테스트 완료
4
+ - python 환경설정: conda env (webdev) with python=3.5
5
+ - 필요 팩키지: Flask, opencv, pillow
6
+ - **최종적으로 Naver Server 에 REST API 를 Flask framework 을 이용하여 서비스함.**
7
+
8
+ - Windows 10 test: working on anaconda environment with pyTh37-pyTorch-Opencv420-office.yml
9
+ - 테스팅 파라미터는 config/config.py 를 참조.
10
+
11
+ ```angular2html
12
+ 0. 음식데이터 라벨은 카테코리 표준코드 관리의 최종코드를 참조하여 class 로 분리함...
13
+ 1. 현재 3165종으로 구분함..
14
+ 2. YOLO 공식 홈페이지에서 제안하기로는 클래당 적어도 2000개이상의 영상이 필요함.
15
+ 3. 현재 PHOTOMATO dataset 기준으로 1000번 수행 기준 2GPU 로 10시간씩 걸림..
16
+ 4. 적어도 100,000번의 수행이 경험상 필요하다고 판단되나 시간관계상 20000번을 통해 모델 취득
17
+ 5. 중간결과 분석
18
+ 13000번 수행 쑥개떡(class_id:384), 멍게(class_id:563)의 경우
19
+ "쑥개떡 0.78852534 - confidence: 0.7352499 - thres : 0.1" :
20
+ "멍게 0.67948073 - confidence: 0.59680355 - thres : 0.1 " :
21
+ 계속 수행함에 따라(약 200 epoch 더 진행 후, 2시간 후).
22
+ "쑥개떡 0.78726465 - confidence: 0.6972475 - thres : 0.1" :
23
+ "멍게 0.7939826 - confidence: 0.69312614 - thres : 0.1 " :
24
+ 로 제대로 인식함..
25
+ 15000번: 멍게의 경우보면 상당히 성능 좋아 있음.
26
+ 쑥개떡을 보면 아직 불안정한 것으로 판단할 수 있음
27
+ 쑥개떡: 0.55149615 - confidence: 0.4864739 - thres : 0.1
28
+ 멍게: 0.93912053 - confidence: 0.65867484
29
+
30
+ ```
31
+ ## Preparing data
32
+ ```angular2html
33
+ 1. data 준비
34
+ 영상의 위치는 상관이 없으나 기계적인 처리를 위해 json 파일이 같은 폴더안에 존재하는게 좋다.
35
+ json-> yolo txt 파일 포맷 (class_id, center_x, center_y, width, height)의 tuple 로
36
+ 저장이 되어 있어야 한다. 단 좌표는 체를 둘러쌓는 box의 중심, 가로길이, 세로길이는 반드시 전체영상의 가로와 세로로 정규화 되어야 한다.
37
+ 2. data가 준비되 training data:validation data의 비율에 따라
38
+ train.txt val.txt에 나누어 목록을 만든다. 현재의 문서는 (8:2)로 비율을 정하였다.
39
+ 3. class/label/category를 나타내는 목록은
40
+ ./yolo/data/food/food-classes.names 넣어져야 한다. 현재 3165개의 클래스가 들어가 있다.
41
+ ```
42
+ ## Training
43
+ ```angular2html
44
+ 1. 데이터가 준비가 되면 ./yolo/config/food-darknet-v1.data 에 아래와 같이 훈련에 사용할 train list, validation list,
45
+ 클래스 정의, 그리고 모델을 임시 저장할 폴더 등에 대하 정의를 다음과 같이 한다. 본인의 환경 맞게 해 주면 된다.
46
+ classes =3165
47
+ train = /workspace/food_classification/yolo/data/food/food_train_20210211.txt
48
+ valid = /workspace/food_classification/yolo/data/food/food_val_20210211.txt
49
+ names = /workspace/food_classification/yolo/data/food/food-classes.names
50
+ backup = /workspace/food_classification/yolo/data/food/weights/
51
+ 2. docker를 통해 미리 만들어진 container로 들어간다. (docker 유경험자는 알겠지만 image가 없으면 자동으로 archive에서 받게 된다.)
52
+ $ sudo docker run --gpus all -it -v ~/workspace:/workspace --ipc=host sangkny/darknet:yolov4 /bin/bash
53
+ 3. docker 내에서 training을 시작한다.
54
+ $ ./darknet detector train /workspace/food-classifier/yolo/config/food-darknet-v1.data /workspace/food-classifier/yolo/config/food-dark-yolov3-tiny_3l-v3-2.cfg /workspace/food-classifier/yolo/config/darknet53.conv.74 -gpus 0,1 2>&1 |tee /workspace/food-classifier/yolo/data/food/food-train-v3-highGPU.log
55
+ ```
56
+
57
+ ### Inference and WebService
58
+ ```angular2html
59
+ 1. 훈련된 모델에 대한 테스트는 conda 가상환경을 만들고 그안에서 실시했다.
60
+ $ conda create --name webdev python=3.5 flask, opencv=3.4.2, pillow
61
+ $ conda activate webdev
62
+ 위의 명령까지 정상적으로 실행이 되면 가상환경 내에 있어야 하며 다음과 유사한 프롬프트 상에 놓이게 된다.
63
+ $ (webdev)
64
+ 2. 본격적인 inference test는 food_classifier_yolo.py 로 구현이 되어 있으면
65
+ $ python food_classifier_yolo.py 를 실행하면 된다.
66
+ 각종 parameter 조정은 ./config/config.py 참조하여 조절하면 된다.
67
+ 3. REST API Flask framework 를 통해 구현하였다.
68
+ $ python WebAPI.py
69
+ 를 실행하면 된다. 특히, local ip(0.0.0.0, 127.0.0.1) 을 ubuntu, windows 각각 local host로 넣어주어야 한다.
70
+ local host는 서버 본체이며, 포트(내/외부 경로 공통)를 통해 외부에서 들어오는 요청을 받아들이게 된다. 외부에서의 요청은
71
+ 공식 웹서버 ip를 통해 전달된다.
72
+ web환경에 맞게 WebAPI.py 제일 마지막 main 함수에 있는 ip 와 port를 조정하여 서비스를 하면 된다.
73
+ 현재 네이버 서버는 http://xxx.xxx.xx.x:8080/uploader 로 접속을 하면 파일을 전송하라는 webpage가 뜨고
74
+ 적절한 파일을 선택 후 전송을 하여 request를 하면
75
+ 잠시후 서버에서 json의 포맷으로 탐지된 물체에 대한 정보를 나타나게 된다.
76
+ 4. 이렇게 웹서버에 띄워놓은 framework(Flask)가 로그 아웃이 되어도 지속되게 하기 위해 제일 마지막에 &를 붙여
77
+ $ python WepAPI.py &
78
+ 백그라운드에 daemon 같이 ��� 수 있다.
79
+ 특정 process가 죽어도 계속 써비스 하기 우해서는 no hang up의 약자인 nohup을 앞에 붙여 사용한다.
80
+ $ hohup python WepAPI.py &
81
+ 여기에 로그를 저장하고 싶으면
82
+ $ nohup python WebAPI.py > app.log &
83
+ 사용하면 된다. 하지만 화면에 출력까지 보고 싶다면,
84
+ $ nohup python WebAPI.py 2>&1 |tee app.log &
85
+ 하면된다.
86
+ 5. 웹서버의 응답은 WebAPI.py 에 정의된 것과 같이..
87
+ (ClassID, ClassName, x, y, width, height) 를 탐지된 물체의 개수 만큼 json format 으로 넘겨주게 된다.
88
+
89
+ ----------- 함수 정의 ------- WepAPI.py 의 food_classifier_Json(image) 은 food_classifier_yolo.py 에 있음 ---------------
90
+ def food_classifier_Json(image):
91
+ # do somthing
92
+ print(args.showText)
93
+ locations = food_classifier_pipeline(frame=image) #[(2321, 0, 0, 10, 10)] # list of (id, rect) from classification
94
+ jsons = []
95
+ for j,location in enumerate(locations):
96
+ class_id, x, y, width, height =location
97
+ res_json = {}
98
+ res_json["ClassID"] = classes_codes[class_id] # code , class_id (training class)
99
+ res_json["ClassName"] = classes[class_id]
100
+ res_json["x"] = int(x)
101
+ res_json["y"] = int(y)
102
+ res_json["w"] = int(width)
103
+ res_json["h"] = int(height)
104
+ jsons.append(res_json)
105
+ print(json.dumps(jsons,ensure_ascii=False)) # debug purpose
106
+
107
+ return json.dumps(jsons,ensure_ascii=False)
108
+
109
+ 6. 서버를 재 부팅시 위의 설정에 요구되는 사항은 CTL 등은 서버관리자에게 설정을 하게 하면 된다.
110
+ ```
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
WebAPI.py ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- encoding: utf-8 -*-
2
+ # This file supports web-based object classfication
3
+ # by sangkny
4
+ # modified by speedpointer
5
+ # -------------------------------------------------
6
+ from flask import Flask, render_template, request
7
+ from werkzeug.utils import secure_filename
8
+
9
+ import cv2
10
+ import numpy as np
11
+
12
+ from food_classifier_yolo import food_classifier_Json
13
+ # classification function
14
+
15
+ app = Flask(__name__)
16
+ #App name
17
+
18
+ def recognize(filename):
19
+ image = cv2.imread(filename) # be careful for hangul name
20
+ # read file and put it into an image array
21
+ return food_classifier_Json(image=image)
22
+ # classification for food images
23
+
24
+ import base64
25
+
26
+ # for hangul file name
27
+ def recognizeBase64(base64_code):
28
+ file_bytes = np.asarray(bytearray(base64.b64decode(base64_code)),dtype=np.uint8)
29
+ image_data_ndarray = cv2.imdecode(file_bytes,1)
30
+ return food_classifier_Json(image_data_ndarray)
31
+
32
+ import time
33
+
34
+ @app.route('/uploader', methods=['GET', 'POST'])# request routing
35
+ def upload_file():
36
+ if request.method == 'POST':
37
+ # if POST case
38
+ f = request.files['file']
39
+ f.save("./images_rec/"+secure_filename(f.filename))
40
+ # saving the requested file
41
+ t0 = time.time()
42
+ res = recognize("./images_rec/"+secure_filename(f.filename))
43
+ print("elapsed time:",time.time() - t0)
44
+ return res
45
+ # return the result
46
+
47
+ # return 'file uploaded successfully'
48
+ return render_template('upload.html')
49
+
50
+ if __name__ == '__main__':
51
+ # input
52
+ ip_address = "0.0.0.0"#"127.0.0.1"
53
+ port_number = 3000 #8000
54
+ app.run(ip_address,port=int(port_number))
55
+ # run app with ip and port numbers
56
+
app.log ADDED
@@ -0,0 +1,781 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ nohup: ignoring input
2
+ * Serving Flask app "WebAPI" (lazy loading)
3
+ * Environment: production
4
+ WARNING: This is a development server. Do not use it in a production deployment.
5
+ Use a production WSGI server instead.
6
+ * Debug mode: off
7
+ * Running on http://0.0.0.0:3000/ (Press CTRL+C to quit)
8
+ 125.243.32.134 - - [25/Feb/2021 11:45:53] "GET /uploader HTTP/1.1" 200 -
9
+ 125.243.32.134 - - [25/Feb/2021 11:46:05] "POST /uploader HTTP/1.1" 200 -
10
+ 125.243.32.134 - - [25/Feb/2021 11:47:41] "GET /uploader HTTP/1.1" 200 -
11
+ 125.243.32.134 - - [25/Feb/2021 11:48:53] "POST /uploader HTTP/1.1" 200 -
12
+ 125.243.32.134 - - [25/Feb/2021 12:02:43] "GET /uploader HTTP/1.1" 200 -
13
+ 118.67.133.131 - - [25/Feb/2021 12:27:29] "POST /uploader HTTP/1.1" 200 -
14
+ 118.67.133.131 - - [25/Feb/2021 12:27:58] "POST /uploader HTTP/1.1" 200 -
15
+ 118.67.133.131 - - [25/Feb/2021 12:33:11] "POST /uploader HTTP/1.1" 200 -
16
+ 118.67.133.131 - - [25/Feb/2021 12:43:30] "POST /uploader HTTP/1.1" 200 -
17
+ 118.67.133.131 - - [25/Feb/2021 12:44:22] "POST /uploader HTTP/1.1" 200 -
18
+ 118.67.133.131 - - [25/Feb/2021 12:58:19] "POST /uploader HTTP/1.1" 200 -
19
+ 118.67.133.131 - - [25/Feb/2021 12:59:52] "POST /uploader HTTP/1.1" 200 -
20
+ 118.67.133.131 - - [25/Feb/2021 13:09:29] "POST /uploader HTTP/1.1" 200 -
21
+ 118.67.133.131 - - [25/Feb/2021 13:11:49] "POST /uploader HTTP/1.1" 200 -
22
+ 118.67.133.131 - - [25/Feb/2021 13:14:56] "POST /uploader HTTP/1.1" 200 -
23
+ 118.67.133.131 - - [25/Feb/2021 13:16:51] "POST /uploader HTTP/1.1" 200 -
24
+ 1
25
+ out.shape : (507, 3170)
26
+ obj score: 0.9699368 - confidence: 0.9692912 - thres : 0.1
27
+ obj score: 0.4339592 - confidence: 0.0 - thres : 0.1
28
+ out.shape : (2028, 3170)
29
+ out.shape : (8112, 3170)
30
+ [{"x": 587, "framewidth": 2449, "ClassName": "바게트빵", "w": 1205, "ClassID": "A020112", "h": 536, "frameheight": 1633, "y": 459}]
31
+ elapsed time: 1.260960578918457
32
+ 1
33
+ out.shape : (507, 3170)
34
+ obj score: 0.9699368 - confidence: 0.9692912 - thres : 0.1
35
+ obj score: 0.4339592 - confidence: 0.0 - thres : 0.1
36
+ out.shape : (2028, 3170)
37
+ out.shape : (8112, 3170)
38
+ [{"x": 587, "framewidth": 2449, "ClassName": "바게트빵", "w": 1205, "ClassID": "A020112", "h": 536, "frameheight": 1633, "y": 459}]
39
+ elapsed time: 1.1979155540466309
40
+ 1
41
+ out.shape : (507, 3170)
42
+ obj score: 0.1948593 - confidence: 0.0 - thres : 0.1
43
+ obj score: 0.12583147 - confidence: 0.0 - thres : 0.1
44
+ out.shape : (2028, 3170)
45
+ out.shape : (8112, 3170)
46
+ []
47
+ elapsed time: 1.3625829219818115
48
+ 1
49
+ out.shape : (507, 3170)
50
+ obj score: 0.37945047 - confidence: 0.0 - thres : 0.1
51
+ obj score: 0.56398195 - confidence: 0.26541716 - thres : 0.1
52
+ obj score: 0.27739364 - confidence: 0.0 - thres : 0.1
53
+ obj score: 0.116471924 - confidence: 0.0 - thres : 0.1
54
+ obj score: 0.2095417 - confidence: 0.0 - thres : 0.1
55
+ obj score: 0.4742067 - confidence: 0.0 - thres : 0.1
56
+ obj score: 0.17590275 - confidence: 0.0 - thres : 0.1
57
+ out.shape : (2028, 3170)
58
+ out.shape : (8112, 3170)
59
+ [{"x": -296, "framewidth": 3000, "ClassName": "물미역", "w": 2670, "ClassID": "A260206", "h": 2452, "frameheight": 4000, "y": 1119}]
60
+ elapsed time: 1.4194393157958984
61
+ 1
62
+ out.shape : (507, 3170)
63
+ obj score: 0.15587588 - confidence: 0.0 - thres : 0.1
64
+ obj score: 0.28064254 - confidence: 0.0 - thres : 0.1
65
+ obj score: 0.7351788 - confidence: 0.0 - thres : 0.1
66
+ obj score: 0.3750209 - confidence: 0.0 - thres : 0.1
67
+ obj score: 0.9473051 - confidence: 0.0 - thres : 0.1
68
+ obj score: 0.45665538 - confidence: 0.37565553 - thres : 0.1
69
+ obj score: 0.14845182 - confidence: 0.0 - thres : 0.1
70
+ obj score: 0.512298 - confidence: 0.0 - thres : 0.1
71
+ obj score: 0.7468566 - confidence: 0.7288364 - thres : 0.1
72
+ obj score: 0.109174296 - confidence: 0.0 - thres : 0.1
73
+ out.shape : (2028, 3170)
74
+ out.shape : (8112, 3170)
75
+ [{"x": 353, "framewidth": 3024, "ClassName": "인삼", "w": 2374, "ClassID": "A260173", "h": 2266, "frameheight": 4032, "y": 1116}]
76
+ elapsed time: 1.4284100532531738
77
+ 1
78
+ out.shape : (507, 3170)
79
+ obj score: 0.27045858 - confidence: 0.0 - thres : 0.1
80
+ obj score: 0.5211713 - confidence: 0.0 - thres : 0.1
81
+ obj score: 0.25349522 - confidence: 0.0 - thres : 0.1
82
+ obj score: 0.48735508 - confidence: 0.0 - thres : 0.1
83
+ obj score: 0.11656608 - confidence: 0.0 - thres : 0.1
84
+ obj score: 0.6559611 - confidence: 0.0 - thres : 0.1
85
+ out.shape : (2028, 3170)
86
+ out.shape : (8112, 3170)
87
+ []
88
+ elapsed time: 1.4360933303833008
89
+ 1
90
+ out.shape : (507, 3170)
91
+ obj score: 0.3123151 - confidence: 0.0 - thres : 0.1
92
+ obj score: 0.6347401 - confidence: 0.0 - thres : 0.1
93
+ obj score: 0.46009225 - confidence: 0.0 - thres : 0.1
94
+ obj score: 0.9065884 - confidence: 0.0 - thres : 0.1
95
+ obj score: 0.9836128 - confidence: 0.0 - thres : 0.1
96
+ obj score: 0.984327 - confidence: 0.9285645 - thres : 0.1
97
+ obj score: 0.93019205 - confidence: 0.0 - thres : 0.1
98
+ obj score: 0.17871094 - confidence: 0.0 - thres : 0.1
99
+ obj score: 0.69968784 - confidence: 0.0 - thres : 0.1
100
+ obj score: 0.56702 - confidence: 0.0 - thres : 0.1
101
+ obj score: 0.28111064 - confidence: 0.0 - thres : 0.1
102
+ obj score: 0.12126979 - confidence: 0.0 - thres : 0.1
103
+ obj score: 0.6704581 - confidence: 0.669163 - thres : 0.1
104
+ obj score: 0.5470945 - confidence: 0.0 - thres : 0.1
105
+ obj score: 0.3136402 - confidence: 0.0 - thres : 0.1
106
+ obj score: 0.1065458 - confidence: 0.0 - thres : 0.1
107
+ obj score: 0.13982871 - confidence: 0.0 - thres : 0.1
108
+ obj score: 0.18792705 - confidence: 0.0 - thres : 0.1
109
+ obj score: 0.19129182 - confidence: 0.0 - thres : 0.1
110
+ out.shape : (2028, 3170)
111
+ out.shape : (8112, 3170)
112
+ [{"x": 6, "framewidth": 3000, "ClassName": "바게트빵", "w": 2987, "ClassID": "A020112", "h": 2335, "frameheight": 4000, "y": 540}]
113
+ elapsed time: 1.373570442199707
114
+ 1
115
+ out.shape : (507, 3170)
116
+ obj score: 0.12036621 - confidence: 0.0 - thres : 0.1
117
+ obj score: 0.17435054 - confidence: 0.0 - thres : 0.1
118
+ obj score: 0.17181547 - confidence: 0.0 - thres : 0.1
119
+ obj score: 0.938802 - confidence: 0.0 - thres : 0.1
120
+ obj score: 0.96647227 - confidence: 0.3490205 - thres : 0.1
121
+ obj score: 0.9648599 - confidence: 0.3455422 - thres : 0.1
122
+ obj score: 0.96931654 - confidence: 0.9245625 - thres : 0.1
123
+ obj score: 0.4979174 - confidence: 0.0 - thres : 0.1
124
+ obj score: 0.6078051 - confidence: 0.0 - thres : 0.1
125
+ obj score: 0.8428788 - confidence: 0.0 - thres : 0.1
126
+ obj score: 0.9461159 - confidence: 0.31178638 - thres : 0.1
127
+ obj score: 0.9447938 - confidence: 0.0 - thres : 0.1
128
+ obj score: 0.5474485 - confidence: 0.0 - thres : 0.1
129
+ obj score: 0.14338121 - confidence: 0.0 - thres : 0.1
130
+ obj score: 0.10363934 - confidence: 0.0 - thres : 0.1
131
+ out.shape : (2028, 3170)
132
+ out.shape : (8112, 3170)
133
+ [{"x": 331, "framewidth": 3024, "ClassName": "마늘빵", "w": 2811, "ClassID": "A020108", "h": 2269, "frameheight": 4032, "y": 955}]
134
+ elapsed time: 1.460747480392456
135
+ 1
136
+ out.shape : (507, 3170)
137
+ obj score: 0.7571344 - confidence: 0.0 - thres : 0.1
138
+ obj score: 0.95487005 - confidence: 0.89353234 - thres : 0.1
139
+ obj score: 0.9589344 - confidence: 0.0 - thres : 0.1
140
+ obj score: 0.9145004 - confidence: 0.0 - thres : 0.1
141
+ obj score: 0.30208638 - confidence: 0.0 - thres : 0.1
142
+ obj score: 0.30014905 - confidence: 0.0 - thres : 0.1
143
+ obj score: 0.7086738 - confidence: 0.0 - thres : 0.1
144
+ obj score: 0.84738624 - confidence: 0.0 - thres : 0.1
145
+ obj score: 0.7692006 - confidence: 0.0 - thres : 0.1
146
+ obj score: 0.110810764 - confidence: 0.0 - thres : 0.1
147
+ out.shape : (2028, 3170)
148
+ out.shape : (8112, 3170)
149
+ [{"x": -148, "framewidth": 3024, "ClassName": "마늘빵", "w": 2868, "ClassID": "A020108", "h": 2069, "frameheight": 4032, "y": 1058}]
150
+ elapsed time: 1.3806674480438232
151
+ 1
152
+ out.shape : (507, 3170)
153
+ obj score: 0.18695068 - confidence: 0.0 - thres : 0.1
154
+ obj score: 0.37288356 - confidence: 0.36899096 - thres : 0.1
155
+ out.shape : (2028, 3170)
156
+ out.shape : (8112, 3170)
157
+ [{"x": 878, "framewidth": 3024, "ClassName": "쑥개떡", "w": 1241, "ClassID": "A240213", "h": 1488, "frameheight": 4032, "y": 1191}]
158
+ elapsed time: 1.474802017211914
159
+ 1
160
+ out.shape : (507, 3170)
161
+ obj score: 0.59684366 - confidence: 0.59596765 - thres : 0.1
162
+ out.shape : (2028, 3170)
163
+ out.shape : (8112, 3170)
164
+ [{"x": 906, "framewidth": 3024, "ClassName": "쑥개떡", "w": 1260, "ClassID": "A240213", "h": 1528, "frameheight": 4032, "y": 1509}]
165
+ elapsed time: 1.4641056060791016
166
+ 1
167
+ out.shape : (507, 3170)
168
+ obj score: 0.20400363 - confidence: 0.0 - thres : 0.1
169
+ out.shape : (2028, 3170)
170
+ out.shape : (8112, 3170)
171
+ []
172
+ elapsed time: 1.4233872890472412
173
+ 1
174
+ out.shape : (507, 3170)
175
+ obj score: 0.47585425 - confidence: 0.46526697 - thres : 0.1
176
+ obj score: 0.13532557 - confidence: 0.0 - thres : 0.1
177
+ out.shape : (2028, 3170)
178
+ out.shape : (8112, 3170)
179
+ [{"x": 845, "framewidth": 3024, "ClassName": "쑥개떡", "w": 1254, "ClassID": "A240213", "h": 1675, "frameheight": 4032, "y": 936}]
180
+ elapsed time: 1.4147543907165527
181
+ 1
182
+ out.shape : (507, 3170)
183
+ obj score: 0.24081504 - confidence: 0.0 - thres : 0.1
184
+ obj score: 0.5732863 - confidence: 0.0 - thres : 0.1
185
+ obj score: 0.7034317 - confidence: 0.0 - thres : 0.1
186
+ obj score: 0.34889942 - confidence: 0.0 - thres : 0.1
187
+ obj score: 0.8115133 - confidence: 0.5817147 - thres : 0.1
188
+ obj score: 0.96638817 - confidence: 0.0 - thres : 0.1
189
+ obj score: 0.97867537 - confidence: 0.97723 - thres : 0.1
190
+ obj score: 0.5284866 - confidence: 0.2205038 - thres : 0.1
191
+ obj score: 0.9352525 - confidence: 0.0 - thres : 0.1
192
+ obj score: 0.97035486 - confidence: 0.0 - thres : 0.1
193
+ obj score: 0.9616611 - confidence: 0.0 - thres : 0.1
194
+ obj score: 0.93727493 - confidence: 0.0 - thres : 0.1
195
+ obj score: 118.67.133.131 - - [25/Feb/2021 13:21:19] "POST /uploader HTTP/1.1" 200 -
196
+ 118.67.133.131 - - [25/Feb/2021 13:27:43] "POST /uploader HTTP/1.1" 200 -
197
+ 118.67.133.131 - - [25/Feb/2021 13:40:44] "POST /uploader HTTP/1.1" 200 -
198
+ 118.67.133.131 - - [25/Feb/2021 13:54:02] "POST /uploader HTTP/1.1" 200 -
199
+ 118.67.133.131 - - [25/Feb/2021 13:54:43] "POST /uploader HTTP/1.1" 200 -
200
+ 118.67.133.131 - - [25/Feb/2021 13:57:56] "POST /uploader HTTP/1.1" 200 -
201
+ 118.67.133.131 - - [25/Feb/2021 13:58:18] "POST /uploader HTTP/1.1" 200 -
202
+ 118.67.133.131 - - [25/Feb/2021 14:00:19] "POST /uploader HTTP/1.1" 200 -
203
+ 118.67.133.131 - - [25/Feb/2021 14:00:45] "POST /uploader HTTP/1.1" 200 -
204
+ 118.67.133.131 - - [25/Feb/2021 14:01:04] "POST /uploader HTTP/1.1" 200 -
205
+ 118.67.133.131 - - [25/Feb/2021 14:01:19] "POST /uploader HTTP/1.1" 200 -
206
+ 118.67.133.131 - - [25/Feb/2021 14:01:37] "POST /uploader HTTP/1.1" 200 -
207
+ 118.67.133.131 - - [25/Feb/2021 14:01:50] "POST /uploader HTTP/1.1" 200 -
208
+ 118.67.133.131 - - [25/Feb/2021 14:02:06] "POST /uploader HTTP/1.1" 200 -
209
+ 0.9439137 - confidence: 0.0 - thres : 0.1
210
+ obj score: 0.2232606 - confidence: 0.0 - thres : 0.1
211
+ obj score: 0.92962205 - confidence: 0.8811631 - thres : 0.1
212
+ obj score: 0.9636179 - confidence: 0.6999781 - thres : 0.1
213
+ obj score: 0.8984838 - confidence: 0.0 - thres : 0.1
214
+ obj score: 0.67779773 - confidence: 0.0 - thres : 0.1
215
+ obj score: 0.49658996 - confidence: 0.0 - thres : 0.1
216
+ obj score: 0.16618112 - confidence: 0.0 - thres : 0.1
217
+ obj score: 0.14594193 - confidence: 0.0 - thres : 0.1
218
+ out.shape : (2028, 3170)
219
+ out.shape : (8112, 3170)
220
+ [{"x": 999, "framewidth": 3024, "ClassName": "바게트빵", "w": 1878, "ClassID": "A020112", "h": 3373, "frameheight": 4032, "y": 339}]
221
+ elapsed time: 1.428248405456543
222
+ 1
223
+ out.shape : (507, 3170)
224
+ obj score: 0.1124442 - confidence: 0.0 - thres : 0.1
225
+ obj score: 0.19231246 - confidence: 0.0 - thres : 0.1
226
+ out.shape : (2028, 3170)
227
+ out.shape : (8112, 3170)
228
+ []
229
+ elapsed time: 1.394395112991333
230
+ 1
231
+ out.shape : (507, 3170)
232
+ obj score: 0.10592354 - confidence: 0.0 - thres : 0.1
233
+ obj score: 0.23797987 - confidence: 0.0 - thres : 0.1
234
+ obj score: 0.48428386 - confidence: 0.0 - thres : 0.1
235
+ obj score: 0.6837413 - confidence: 0.0 - thres : 0.1
236
+ obj score: 0.9344378 - confidence: 0.0 - thres : 0.1
237
+ obj score: 0.96961516 - confidence: 0.5889796 - thres : 0.1
238
+ obj score: 0.98047364 - confidence: 0.9769158 - thres : 0.1
239
+ obj score: 0.22957435 - confidence: 0.0 - thres : 0.1
240
+ obj score: 0.4286951 - confidence: 0.0 - thres : 0.1
241
+ obj score: 0.7285218 - confidence: 0.0 - thres : 0.1
242
+ obj score: 0.56875646 - confidence: 0.0 - thres : 0.1
243
+ obj score: 0.27573687 - confidence: 0.0 - thres : 0.1
244
+ out.shape : (2028, 3170)
245
+ out.shape : (8112, 3170)
246
+ [{"x": 968, "framewidth": 3024, "ClassName": "바게트빵", "w": 1962, "ClassID": "A020112", "h": 2989, "frameheight": 4032, "y": 796}]
247
+ elapsed time: 1.4690446853637695
248
+ 1
249
+ out.shape : (507, 3170)
250
+ out.shape : (2028, 3170)
251
+ out.shape : (8112, 3170)
252
+ []
253
+ elapsed time: 1.4028847217559814
254
+ 1
255
+ out.shape : (507, 3170)
256
+ obj score: 0.1482152 - confidence: 0.0 - thres : 0.1
257
+ obj score: 0.23114434 - confidence: 0.23055753 - thres : 0.1
258
+ obj score: 0.22987355 - confidence: 0.0 - thres : 0.1
259
+ out.shape : (2028, 3170)
260
+ out.shape : (8112, 3170)
261
+ [{"x": 797, "framewidth": 3024, "ClassName": "쑥개떡", "w": 1332, "ClassID": "A240213", "h": 1735, "frameheight": 4032, "y": 897}]
262
+ elapsed time: 1.3675835132598877
263
+ 1
264
+ out.shape : (507, 3170)
265
+ obj score: 0.106485896 - confidence: 0.0 - thres : 0.1
266
+ obj score: 0.13856125 - confidence: 0.0 - thres : 0.1
267
+ out.shape : (2028, 3170)
268
+ out.shape : (8112, 3170)
269
+ []
270
+ elapsed time: 1.4121015071868896
271
+ 1
272
+ out.shape : (507, 3170)
273
+ obj score: 0.4626748 - confidence: 0.3870303 - thres : 0.1
274
+ obj score: 0.1725152 - confidence: 0.0 - thres : 0.1
275
+ out.shape : (2028, 3170)
276
+ out.shape : (8112, 3170)
277
+ [{"x": 804, "framewidth": 3024, "ClassName": "쑥개떡", "w": 1288, "ClassID": "A240213", "h": 1613, "frameheight": 4032, "y": 1495}]
278
+ elapsed time: 1.3647465705871582
279
+ 1
280
+ out.shape : (507, 3170)
281
+ obj score: 0.5277948 - confidence: 0.51834565 - thres : 0.1
282
+ obj score: 0.16254549 - confidence: 0.0 - thres : 0.1
283
+ out.shape : (2028, 3170)
284
+ out.shape : (8112, 3170)
285
+ [{"x": 1119, "framewidth": 3024, "ClassName": "쑥개떡", "w": 1153, "ClassID": "A240213", "h": 1733, "frameheight": 4032, "y": 1486}]
286
+ elapsed time: 1.4336187839508057
287
+ 1
288
+ out.shape : (507, 3170)
289
+ obj score: 0.22919439 - confidence: 0.0 - thres : 0.1
290
+ obj score: 0.10506311 - confidence: 0.0 - thres : 0.1
291
+ obj score: 0.4933572 - confidence: 0.49276498 - thres : 0.1
292
+ obj score: 0.11302084 - confidence: 0.0 - thres : 0.1
293
+ out.shape : (2028, 3170)
294
+ out.shape : (8112, 3170)
295
+ [{"x": 1093, "framewidth": 3024, "ClassName": "쑥개떡", "w": 1271, "ClassID": "A240213", "h": 1594, "frameheight": 4032, "y": 1446}]
296
+ elapsed time: 1.4358241558074951
297
+ 1
298
+ out.shape : (507, 3170)
299
+ obj score: 0.28573737 - confidence: 0.0 - thres : 0.1
300
+ obj score: 0.8015044 - confidence: 0.26266626 - thres : 0.1
301
+ out.shape : (2028, 3170)
302
+ obj score: 0.19794518 - confidence: 0.0 - thres : 0.1
303
+ obj score: 0.20874026 - confidence: 0.0 - thres : 0.1
304
+ out.shape : (8112, 3170)
305
+ [{"x": 1058, "framewidth": 3024, "ClassName": "크로와상", "w": 1299, "ClassID": "A020140", "h": 1221, "frameheight": 4032, "y": 1614}]
306
+ elapsed time: 1.489638090133667
307
+ 1
308
+ out.shape : (507, 3170)
309
+ obj score: 0.75523084 - confidence: 0.37170273 - thres : 0.1
310
+ obj score: 0.28939563 - confidence: 0.0 - thres : 0.1
311
+ obj score: 0.7408998 - confidence: 0.0 - thres : 0.1
312
+ out.shape : (2028, 3170)
313
+ out.shape : (8112, 3170)
314
+ [{"x": 501, "framewidth": 3024, "ClassName": "크로와상", "w": 1652, "ClassID": "A020140", "h": 1587, "frameheight": 4032, "y": 1334}]
315
+ elapsed time: 1.3848927021026611
316
+ 1
317
+ out.shape : (507, 3170)
318
+ obj score: 0.3230213 - confidence: 0.0 - thres : 0.1
319
+ obj score: 0.5809328 - confidence: 0.0 - thres : 0.1
320
+ obj score: 0.15432024 - confidence: 0.0 - thres : 0.1
321
+ obj score: 0.25433567 - confidence: 0.0 - thres : 0.1
322
+ obj score: 0.78212863 - confidence: 0.0 - thres : 0.1
323
+ obj score: 0.70299566 - confidence: 0.0 - thres : 0.1
324
+ obj score: 0.37560314 - confidence: 0.0 - thres : 0.1
325
+ obj score: 0.845549 - confidence: 0.8444035 - thres : 0.1
326
+ obj score: 0.7051678 - confidence: 0.0 - thres : 0.1
327
+ obj score: 0.28123766 - confidence: 0.0 - thres : 0.1
328
+ obj score: 0.73580647 - confidence: 0.0 - thres : 0.1
329
+ obj score: 0.37738693 - confidence: 0.0 - thres : 0.1
330
+ out.shape : (2028, 3170)
331
+ out.shape : (8112, 3170)
332
+ [{"x": 714, "framewidth": 3024, "ClassName": "인삼", "w": 1596, "ClassID": "A260173", "h": 3359, "frameheight": 4032, "y": 328}]
333
+ elapsed time: 1.412980079650879
334
+ 1
335
+ out.shape : (507, 3170)
336
+ obj score: 0.31659618 - confidence: 0.0 - thres : 0.1
337
+ obj score: 0.57621807 - confidence: 0.56266874 - thres : 0.1
338
+ obj score: 0.24399075 - confidence: 0.0 - thres : 0.1
339
+ obj score: 0.12713125 - confidence: 0.0 - thres : 0.1
340
+ obj score: 0.38459858 - confidence: 0.0 - thres : 0.1
341
+ obj score: 0.4522718 - confidence: 0.0 - thres : 0.1
342
+ obj score: 0.1006953 - confidence: 0.0 - thres : 0.1
343
+ obj score: 0.4302598 - confidence: 0.0 - thres : 0.1
344
+ obj score: 0.7841026 - confidence: 0.77369595 - thres : 0.1
345
+ obj score: 0.3978546 - confidence: 0.0 - thres : 0.1
346
+ out.shape : (2028, 3170)
347
+ out.shape : (8112, 3170)
348
+ [{"x": 427, "framewidth": 3024, "ClassName": "인삼", "w": 2149, "ClassID": "A260173", "h": 2219, "frameheight": 4032, "y": 1516}]
349
+ elapsed time: 1.4444103240966797
350
+ 1
351
+ out.shape : (507, 3170)
352
+ obj score: 0.34088856 - confidence: 0.0 - thres : 0.1
353
+ obj score: 0.14119281 - confidence: 0.0 - thres : 0.1
354
+ obj score: 0.75490195 - confidence: 0.0 - thres : 0.1
355
+ obj score: 0.25953686 - confidence: 0.0 - thres : 0.1
356
+ obj score: 0.30911738 - confidence: 0.0 - thres : 0.1
357
+ obj score: 0.14204596 - confidence: 0.0 - thres : 0.1
358
+ obj score: 0.76160324 - confidence: 0.0 - thres : 0.1
359
+ obj score: 0.8907277 - confidence: 0.7077889 - thres : 0.1
360
+ obj score: 0.50361794 - confidence: 0.43511122 - thres : 0.1
361
+ obj score: 0.23731157 - confidence: 0.0 - thres : 0.1
362
+ obj score: 0.4075222 - confidence: 0.0 - thres : 0.1
363
+ out.shape : (2028, 3170)
364
+ out.shape : (8112, 3170)
365
+ [{"x": 244, "framewidth": 3024, "ClassName": "인삼", "w": 2577, "ClassID": "A260173", "h": 2124, "frameheight": 4032, "y": 1234}]
366
+ elapsed time: 1.4357001781463623
367
+ 1
368
+ out.shape : (507, 3170)
369
+ obj score: 0.19834714 - confidence: 0.0 - thres : 0.1
370
+ obj score: 0.15484245 - confidence: 0.0 - thres : 0.1
371
+ obj score: 0.17233108 - confidence: 0.0 - thres : 0.1
372
+ obj score: 0.3800572 - confidence: 0.0 - thres : 0.1
373
+ obj score: 0.3494113 - confidence: 0.0 - thres : 0.1
374
+ obj score: 0.4475223 - confidence: 0.4456543 - thres : 0.1
375
+ obj score: 0.2762655 - confidence: 0.0 - thres : 0.1
376
+ obj score: 0.28315282 - confidence: 0.0 - thres : 0.1
377
+ out.shape : (2028, 3170)
378
+ out.shape : (8112, 3170)
379
+ [{"x": 334, "framewidth": 3024, "ClassName": "바게트빵", "w": 2301, "ClassID": "A020112", "h": 1203, "frameheight": 4032, "y": 1674}]
380
+ elapsed time:118.67.133.131 - - [25/Feb/2021 14:02:17] "POST /uploader HTTP/1.1" 200 -
381
+ 118.67.133.131 - - [25/Feb/2021 14:02:38] "POST /uploader HTTP/1.1" 200 -
382
+ 118.67.133.131 - - [25/Feb/2021 14:04:22] "POST /uploader HTTP/1.1" 200 -
383
+ 118.67.133.131 - - [25/Feb/2021 14:05:31] "POST /uploader HTTP/1.1" 200 -
384
+ 118.67.133.131 - - [25/Feb/2021 14:10:03] "POST /uploader HTTP/1.1" 200 -
385
+ 118.67.133.131 - - [25/Feb/2021 14:10:13] "POST /uploader HTTP/1.1" 200 -
386
+ 118.67.133.131 - - [25/Feb/2021 14:10:26] "POST /uploader HTTP/1.1" 200 -
387
+ 118.67.133.131 - - [25/Feb/2021 14:10:47] "POST /uploader HTTP/1.1" 200 -
388
+ 118.67.133.131 - - [25/Feb/2021 14:11:00] "POST /uploader HTTP/1.1" 200 -
389
+ 118.67.133.131 - - [25/Feb/2021 14:11:27] "POST /uploader HTTP/1.1" 200 -
390
+ 118.67.133.131 - - [25/Feb/2021 14:17:33] "POST /uploader HTTP/1.1" 200 -
391
+ 118.67.133.131 - - [25/Feb/2021 14:18:22] "POST /uploader HTTP/1.1" 200 -
392
+ 118.67.133.131 - - [25/Feb/2021 14:18:42] "POST /uploader HTTP/1.1" 200 -
393
+ 118.67.133.131 - - [25/Feb/2021 14:20:34] "POST /uploader HTTP/1.1" 200 -
394
+ 118.67.133.131 - - [25/Feb/2021 14:21:01] "POST /uploader HTTP/1.1" 200 -
395
+ 118.67.133.131 - - [25/Feb/2021 14:21:24] "POST /uploader HTTP/1.1" 200 -
396
+ 118.67.133.131 - - [25/Feb/2021 14:24:42] "POST /uploader HTTP/1.1" 200 -
397
+ 118.67.133.131 - - [25/Feb/2021 14:24:57] "POST /uploader HTTP/1.1" 200 -
398
+ 118.67.133.131 - - [25/Feb/2021 14:30:18] "POST /uploader HTTP/1.1" 200 -
399
+ 118.67.133.131 - - [25/Feb/2021 14:31:30] "POST /uploader HTTP/1.1" 200 -
400
+ 118.67.133.131 - - [25/Feb/2021 14:35:02] "POST /uploader HTTP/1.1" 200 -
401
+ 1.4776935577392578
402
+ 1
403
+ out.shape : (507, 3170)
404
+ obj score: 0.13977608 - confidence: 0.0 - thres : 0.1
405
+ obj score: 0.40138003 - confidence: 0.0 - thres : 0.1
406
+ obj score: 0.24594568 - confidence: 0.23857212 - thres : 0.1
407
+ obj score: 0.57038766 - confidence: 0.0 - thres : 0.1
408
+ obj score: 0.51924306 - confidence: 0.0 - thres : 0.1
409
+ obj score: 0.3797294 - confidence: 0.0 - thres : 0.1
410
+ obj score: 0.4555872 - confidence: 0.0 - thres : 0.1
411
+ obj score: 0.5556125 - confidence: 0.0 - thres : 0.1
412
+ obj score: 0.63370585 - confidence: 0.0 - thres : 0.1
413
+ obj score: 0.10338429 - confidence: 0.0 - thres : 0.1
414
+ obj score: 0.69885117 - confidence: 0.69734144 - thres : 0.1
415
+ obj score: 0.1428422 - confidence: 0.0 - thres : 0.1
416
+ out.shape : (2028, 3170)
417
+ out.shape : (8112, 3170)
418
+ [{"x": 1190, "framewidth": 3024, "ClassName": "인삼", "w": 1470, "ClassID": "A260173", "h": 2747, "frameheight": 4032, "y": 952}]
419
+ elapsed time: 1.4635474681854248
420
+ 1
421
+ out.shape : (507, 3170)
422
+ obj score: 0.3121353 - confidence: 0.2677779 - thres : 0.1
423
+ obj score: 0.27198926 - confidence: 0.0 - thres : 0.1
424
+ obj score: 0.12370876 - confidence: 0.0 - thres : 0.1
425
+ out.shape : (2028, 3170)
426
+ out.shape : (8112, 3170)
427
+ [{"x": 834, "framewidth": 3024, "ClassName": "쑥개떡", "w": 1207, "ClassID": "A240213", "h": 1923, "frameheight": 4032, "y": 1074}]
428
+ elapsed time: 1.3749988079071045
429
+ 1
430
+ out.shape : (507, 3170)
431
+ obj score: 0.23038213 - confidence: 0.0 - thres : 0.1
432
+ obj score: 0.22028722 - confidence: 0.0 - thres : 0.1
433
+ obj score: 0.51938665 - confidence: 0.51795214 - thres : 0.1
434
+ obj score: 0.11246048 - confidence: 0.0 - thres : 0.1
435
+ out.shape : (2028, 3170)
436
+ out.shape : (8112, 3170)
437
+ [{"x": 899, "framewidth": 3024, "ClassName": "쑥개떡", "w": 1206, "ClassID": "A240213", "h": 1713, "frameheight": 4032, "y": 761}]
438
+ elapsed time: 1.366853952407837
439
+ 1
440
+ out.shape : (507, 3170)
441
+ obj score: 0.10524843 - confidence: 0.0 - thres : 0.1
442
+ obj score: 0.105505824 - confidence: 0.0 - thres : 0.1
443
+ obj score: 0.31181413 - confidence: 0.0 - thres : 0.1
444
+ obj score: 0.16310786 - confidence: 0.0 - thres : 0.1
445
+ obj score: 0.10271885 - confidence: 0.0 - thres : 0.1
446
+ obj score: 0.13271685 - confidence: 0.0 - thres : 0.1
447
+ out.shape : (2028, 3170)
448
+ out.shape : (8112, 3170)
449
+ []
450
+ elapsed time: 1.4340720176696777
451
+ 1
452
+ out.shape : (507, 3170)
453
+ out.shape : (2028, 3170)
454
+ out.shape : (8112, 3170)
455
+ []
456
+ elapsed time: 1.420990228652954
457
+ 1
458
+ out.shape : (507, 3170)
459
+ obj score: 0.15967932 - confidence: 0.0 - thres : 0.1
460
+ obj score: 0.2252205 - confidence: 0.22299531 - thres : 0.1
461
+ obj score: 0.2346376 - confidence: 0.0 - thres : 0.1
462
+ out.shape : (2028, 3170)
463
+ out.shape : (8112, 3170)
464
+ [{"x": 108, "framewidth": 3024, "ClassName": "인삼", "w": 1959, "ClassID": "A260173", "h": 2938, "frameheight": 4032, "y": 245}]
465
+ elapsed time: 1.4275736808776855
466
+ 1
467
+ out.shape : (507, 3170)
468
+ out.shape : (2028, 3170)
469
+ out.shape : (8112, 3170)
470
+ []
471
+ elapsed time: 1.4287307262420654
472
+ 1
473
+ out.shape : (507, 3170)
474
+ out.shape : (2028, 3170)
475
+ out.shape : (8112, 3170)
476
+ []
477
+ elapsed time: 1.440711498260498
478
+ 1
479
+ out.shape : (507, 3170)
480
+ obj score: 0.24393104 - confidence: 0.24038877 - thres : 0.1
481
+ obj score: 0.18885124 - confidence: 0.0 - thres : 0.1
482
+ obj score: 0.17533804 - confidence: 0.0 - thres : 0.1
483
+ out.shape : (2028, 3170)
484
+ out.shape : (8112, 3170)
485
+ [{"x": 985, "framewidth": 3024, "ClassName": "쑥개떡", "w": 1160, "ClassID": "A240213", "h": 1670, "frameheight": 4032, "y": 1160}]
486
+ elapsed time: 1.4569928646087646
487
+ 1
488
+ out.shape : (507, 3170)
489
+ obj score: 0.8831976 - confidence: 0.8825878 - thres : 0.1
490
+ out.shape : (2028, 3170)
491
+ obj score: 0.100112535 - confidence: 0.0 - thres : 0.1
492
+ obj score: 0.18269368 - confidence: 0.0 - thres : 0.1
493
+ out.shape : (8112, 3170)
494
+ [{"x": 542, "framewidth": 1440, "ClassName": "쑥개떡", "w": 328, "ClassID": "A240213", "h": 264, "frameheight": 960, "y": 358}]
495
+ elapsed time: 1.1435835361480713
496
+ 1
497
+ out.shape : (507, 3170)
498
+ obj score: 0.8831976 - confidence: 0.8825878 - thres : 0.1
499
+ out.shape : (2028, 3170)
500
+ obj score: 0.100112535 - confidence: 0.0 - thres : 0.1
501
+ obj score: 0.18269368 - confidence: 0.0 - thres : 0.1
502
+ out.shape : (8112, 3170)
503
+ [{"x": 542, "framewidth": 1440, "ClassName": "쑥개떡", "w": 328, "ClassID": "A240213", "h": 264, "frameheight": 960, "y": 358}]
504
+ elapsed time: 1.1468613147735596
505
+ 1
506
+ out.shape : (507, 3170)
507
+ obj score: 0.8831976 - confidence: 0.8825878 - thres : 0.1
508
+ out.shape : (2028, 3170)
509
+ obj score: 0.100112535 - confidence: 0.0 - thres : 0.1
510
+ obj score: 0.18269368 - confidence: 0.0 - thres : 0.1
511
+ out.shape : (8112, 3170)
512
+ [{"x": 542, "framewidth": 1440, "ClassName": "쑥개떡", "w": 328, "ClassID": "A240213", "h": 264, "frameheight": 960, "y": 358}]
513
+ elapsed time: 1.149827241897583
514
+ 1
515
+ out.shape : (507, 3170)
516
+ obj score: 0.8831976 - confidence: 0.8825878 - thres : 0.1
517
+ out.shape : (2028, 3170)
518
+ obj score: 0.100112535 - confidence: 0.0 - thres : 0.1
519
+ obj score: 0.18269368 - confidence: 0.0 - thres : 0.1
520
+ out.shape : (8112, 3170)
521
+ [{"x": 542, "framewidth": 1440, "ClassName": "쑥개떡", "w": 328, "ClassID": "A240213", "h": 264, "frameheight": 960, "y": 358}]
522
+ elapsed time: 1.175755500793457
523
+ 1
524
+ out.shape : (507, 3170)
525
+ obj score: 0.62764424 - confidence: 0.6256275 - thres : 0.1
526
+ out.shape : (2028, 3170)
527
+ out.shape : (8112, 3170)
528
+ [{"x": 1150, "framewidth": 3024, "ClassName": "쑥개떡", "w": 1212, "ClassID": "A240213", "h": 1548, "frameheight": 4032, "y": 1187}]
529
+ elapsed time: 1.4258933067321777
530
+ 1
531
+ out.shape : (507, 3170)
532
+ obj score: 0.52433866 - confidence: 0.5084444 - thres : 0.1
533
+ out.shape : (2028, 3170)
534
+ out.shape : (8112, 3170)
535
+ [{"x": 969, "framewidth": 3024, "ClassName": "쑥개떡", "w": 1164, "ClassID": "A240213", "h": 1672, "frameheight": 4032, "y": 1119}]
536
+ elapsed time: 1.4331374168395996
537
+ 1
538
+ out.shape : (507, 3170)
539
+ obj score: 0.787515 - confidence: 0.7868684 - thres : 0.1
540
+ obj score: 0.23706035 - confidence: 0.0 - thres : 0.1
541
+ out.shape : (2028, 3170)
542
+ out.shape : (8112, 3170)
543
+ [{"x": 892, "framewidth": 3024, "ClassName": "쑥개떡", "w": 1283, "ClassID": "A240213", "h": 1604, "frameheight": 4032, "y": 1233}]
544
+ elapsed time: 1.3713304996490479
545
+ 1
546
+ out.shape : (507, 3170)
547
+ obj score: 0.22964941 - confidence: 0.0 - thres : 0.1
548
+ obj score: 0.23363326 - confidence: 0.22887903 - thres : 0.1
549
+ obj score: 0.14445809 - confidence: 0.0 - thres : 0.1
550
+ out.shape : (2028, 3170)
551
+ out.shape : (8112, 3170)
552
+ [{"x": 756, "framewidth": 3024, "ClassName": "쑥개떡", "w": 1559, "ClassID": "A240213", "h": 2601, "frameheight": 4032, "y": 1105}]
553
+ elapsed time: 1.427886724472046
554
+ 1
555
+ out.shape : (507, 3170)
556
+ obj score: 0.8831976 - confidence: 0.8825878 - thres : 0.1
557
+ out.shape : (2028, 3170)
558
+ obj score: 0.100112535 - confidence: 0.0 - thres : 0.1
559
+ obj score: 0.18269368 - confidence: 0.0 - thres : 0.1
560
+ out.shape : (8112, 3170)
561
+ [{"x": 542, "framewidth": 1440, "ClassName": "쑥개떡", "w": 328, "ClassID": "A240213", "h": 264, "frameheight": 960, "y": 358}]
562
+ elapsed time: 1.1846718788146973
563
+ 1
564
+ out.shape : (507, 3170)
565
+ obj score: 0.8831976 - confidence: 0.8825878 - thres : 0.1
566
+ out.shape : (2028, 3170)
567
+ obj score: 0.100112535 - confidence: 0.0 - thres : 0.1
568
+ obj score: 0.18269368 - confidence: 0.0 - thres : 0.1
569
+ out.shape : (8112, 3170)
570
+ [{"x": 542, "framewidth": 1440, "ClassName": "쑥개떡", "w": 328, "ClassID": "A240213", "h": 264, "frameheight": 960, "y": 358}]
571
+ elapsed time: 1.1431877613067627
572
+ 1
573
+ out.shape : (507, 3170)
574
+ obj score: 0.9699368 - confidence: 0.9692912 - thres : 0.1
575
+ obj score: 0.4339592 - confidence: 0.0 - thres : 0.1
576
+ out.shape : (2028, 3170)
577
+ out.shape : (8112, 3170)
578
+ [{"x": 587, "framewidth": 2449, "ClassName": "바게트빵", "w": 1205, "ClassID": "A020112", "h": 536, "frameheight": 1633, "y": 459}]
579
+ elapsed time: 1.2475743293762207
580
+ 1
581
+ out.shape : (507, 3170)
582
+ obj score: 0.12023228 - confidence: 0.0 - thres : 0.1
583
+ obj score: 0.17567517 - confidence: 0.0 - thres : 0.1
584
+ obj score: 0.6763358 - confidence: 0.0 - thres : 0.1
585
+ obj score: 0.6854099 - confidence: 0.0 - thres : 0.1
586
+ obj score: 0.2520209 - confidence: 0.0 - thres : 0.1
587
+ obj score: 0.6032635118.67.133.131 - - [25/Feb/2021 15:56:04] "POST /uploader HTTP/1.1" 200 -
588
+ 118.67.133.131 - - [25/Feb/2021 16:13:35] "POST /uploader HTTP/1.1" 200 -
589
+ 125.243.32.134 - - [25/Feb/2021 16:13:40] "POST /uploader HTTP/1.1" 200 -
590
+ 118.67.133.131 - - [25/Feb/2021 18:03:17] "POST /uploader HTTP/1.1" 200 -
591
+ 185.176.222.73 - - [25/Feb/2021 18:12:41] code 400, message Bad HTTP/0.9 request type ('\x03\x00\x00/*à\x00\x00\x00\x00\x00Cookie:')
592
+ 185.176.222.73 - - [25/Feb/2021 18:12:41] "/*àCookie: mstshash=Administr" HTTPStatus.BAD_REQUEST -
593
+ 112.222.233.60 - - [25/Feb/2021 18:26:59] "GET /uploader HTTP/1.1" 200 -
594
+ 112.222.233.60 - - [25/Feb/2021 18:26:59] "GET /favicon.ico HTTP/1.1" 404 -
595
+ 112.222.233.60 - - [25/Feb/2021 18:27:35] "POST /uploader HTTP/1.1" 200 -
596
+ 112.222.233.60 - - [25/Feb/2021 18:29:28] "GET /uploader HTTP/1.1" 200 -
597
+ 112.222.233.60 - - [25/Feb/2021 18:30:24] "POST /uploader HTTP/1.1" 200 -
598
+ 112.222.233.60 - - [25/Feb/2021 18:32:13] "GET /uploader HTTP/1.1" 200 -
599
+ 112.222.233.60 - - [25/Feb/2021 18:32:18] "POST /uploader HTTP/1.1" 200 -
600
+ 112.222.233.60 - - [25/Feb/2021 18:33:23] "GET /uploader HTTP/1.1" 200 -
601
+ 112.222.233.60 - - [25/Feb/2021 18:33:28] "POST /uploader HTTP/1.1" 200 -
602
+ 112.222.233.60 - - [25/Feb/2021 18:33:32] "GET /uploader HTTP/1.1" 200 -
603
+ 112.222.233.60 - - [25/Feb/2021 18:34:17] "POST /uploader HTTP/1.1" 200 -
604
+ 112.222.233.60 - - [25/Feb/2021 18:34:40] "GET /uploader HTTP/1.1" 200 -
605
+ 112.222.233.60 - - [25/Feb/2021 18:46:04] "GET /uploader HTTP/1.1" 200 -
606
+ 118.67.133.131 - - [25/Feb/2021 21:02:04] "POST /uploader HTTP/1.1" 200 -
607
+ 118.67.133.131 - - [25/Feb/2021 21:25:44] "POST /uploader HTTP/1.1" 200 -
608
+ - confidence: 0.0 - thres : 0.1
609
+ obj score: 0.20871645 - confidence: 0.0 - thres : 0.1
610
+ obj score: 0.34965545 - confidence: 0.0 - thres : 0.1
611
+ obj score: 0.61426884 - confidence: 0.5435659 - thres : 0.1
612
+ obj score: 0.58661675 - confidence: 0.20092449 - thres : 0.1
613
+ obj score: 0.43507951 - confidence: 0.0 - thres : 0.1
614
+ obj score: 0.22605768 - confidence: 0.0 - thres : 0.1
615
+ obj score: 0.32287803 - confidence: 0.0 - thres : 0.1
616
+ obj score: 0.15556556 - confidence: 0.0 - thres : 0.1
617
+ obj score: 0.23649815 - confidence: 0.22256704 - thres : 0.1
618
+ obj score: 0.17545334 - confidence: 0.0 - thres : 0.1
619
+ out.shape : (2028, 3170)
620
+ out.shape : (8112, 3170)
621
+ [{"x": 105, "framewidth": 3000, "ClassName": "인삼", "w": 1851, "ClassID": "A260173", "h": 3264, "frameheight": 4000, "y": 377}]
622
+ elapsed time: 1.863832950592041
623
+ 1
624
+ out.shape : (507, 3170)
625
+ obj score: 0.19051495 - confidence: 0.0 - thres : 0.1
626
+ obj score: 0.48144218 - confidence: 0.458524 - thres : 0.1
627
+ out.shape : (2028, 3170)
628
+ out.shape : (8112, 3170)
629
+ [{"x": 722, "framewidth": 3000, "ClassName": "쑥개떡", "w": 1134, "ClassID": "A240213", "h": 1978, "frameheight": 4000, "y": 931}]
630
+ elapsed time: 1.3272285461425781
631
+ 1
632
+ out.shape : (507, 3170)
633
+ obj score: 0.11947048 - confidence: 0.0 - thres : 0.1
634
+ out.shape : (2028, 3170)
635
+ obj score: 0.32518157 - confidence: 0.0 - thres : 0.1
636
+ obj score: 0.24873595 - confidence: 0.0 - thres : 0.1
637
+ obj score: 0.65438396 - confidence: 0.2968539 - thres : 0.1
638
+ obj score: 0.4461359 - confidence: 0.0 - thres : 0.1
639
+ out.shape : (8112, 3170)
640
+ [{"x": 972, "framewidth": 2449, "ClassName": "백설기", "w": 448, "ClassID": "A240208", "h": 397, "frameheight": 1633, "y": 568}]
641
+ elapsed time: 1.5738656520843506
642
+ 1
643
+ out.shape : (507, 3170)
644
+ obj score: 0.9699368 - confidence: 0.9692912 - thres : 0.1
645
+ obj score: 0.4339592 - confidence: 0.0 - thres : 0.1
646
+ out.shape : (2028, 3170)
647
+ out.shape : (8112, 3170)
648
+ [{"x": 587, "framewidth": 2449, "ClassName": "바게트빵", "w": 1205, "ClassID": "A020112", "h": 536, "frameheight": 1633, "y": 459}]
649
+ elapsed time: 1.5469915866851807
650
+ 1
651
+ out.shape : (507, 3170)
652
+ obj score: 0.47187752 - confidence: 0.0 - thres : 0.1
653
+ obj score: 0.73515135 - confidence: 0.0 - thres : 0.1
654
+ obj score: 0.89592934 - confidence: 0.0 - thres : 0.1
655
+ obj score: 0.96933305 - confidence: 0.96238387 - thres : 0.1
656
+ obj score: 0.3389606 - confidence: 0.0 - thres : 0.1
657
+ out.shape : (2028, 3170)
658
+ out.shape : (8112, 3170)
659
+ [{"x": 23, "framewidth": 631, "ClassName": "바게트빵", "w": 578, "ClassID": "A020112", "h": 193, "frameheight": 412, "y": 70}]
660
+ elapsed time: 1.321312665939331
661
+ 1
662
+ out.shape : (507, 3170)
663
+ obj score: 0.50584483 - confidence: 0.0 - thres : 0.1
664
+ obj score: 0.96033764 - confidence: 0.0 - thres : 0.1
665
+ obj score: 0.8447239 - confidence: 0.0 - thres : 0.1
666
+ obj score: 0.7502764 - confidence: 0.59348595 - thres : 0.1
667
+ obj score: 0.93652487 - confidence: 0.0 - thres : 0.1
668
+ obj score: 0.9818812 - confidence: 0.0 - thres : 0.1
669
+ obj score: 0.99484694 - confidence: 0.990013 - thres : 0.1
670
+ obj score: 0.94469273 - confidence: 0.0 - thres : 0.1
671
+ obj score: 0.2582266 - confidence: 0.2394657 - thres : 0.1
672
+ obj score: 0.9921096 - confidence: 0.3964678 - thres : 0.1
673
+ obj score: 0.9838696 - confidence: 0.0 - thres : 0.1
674
+ obj score: 0.9781804 - confidence: 0.0 - thres : 0.1
675
+ obj score: 0.9821507 - confidence: 0.0 - thres : 0.1
676
+ obj score: 0.8417759 - confidence: 0.0 - thres : 0.1
677
+ obj score: 0.24276164 - confidence: 0.0 - thres : 0.1
678
+ obj score: 0.9119776 - confidence: 0.0 - thres : 0.1
679
+ obj score: 0.77694094 - confidence: 0.0 - thres : 0.1
680
+ obj score: 0.56311333 - confidence: 0.0 - thres : 0.1
681
+ obj score: 0.35500804 - confidence: 0.0 - thres : 0.1
682
+ obj score: 0.1245117 - confidence: 0.0 - thres : 0.1
683
+ out.shape : (2028, 3170)
684
+ out.shape : (8112, 3170)
685
+ [{"x": 86, "framewidth": 393, "ClassName": "마늘빵", "w": 284, "ClassID": "A020108", "h": 190, "frameheight": 215, "y": -4}]
686
+ elapsed time: 1.4504072666168213
687
+ 1
688
+ out.shape : (507, 3170)
689
+ obj score: 0.69516087 - confidence: 0.0 - thres : 0.1
690
+ obj score: 0.95567626 - confidence: 0.49878195 - thres : 0.1
691
+ obj score: 0.69158787 - confidence: 0.0 - thres : 0.1
692
+ obj score: 0.13157818 - confidence: 0.0 - thres : 0.1
693
+ obj score: 0.4012235 - confidence: 0.0 - thres : 0.1
694
+ obj score: 0.97148275 - confidence: 0.9670613 - thres : 0.1
695
+ obj score: 0.8570264 - confidence: 0.0 - thres : 0.1
696
+ obj score: 0.29068857 - confidence: 0.0 - thres : 0.1
697
+ obj score: 0.11520081 - confidence: 0.0 - thres : 0.1
698
+ obj score: 0.94443506 - confidence: 0.0 - thres : 0.1
699
+ obj score: 0.9502707 - confidence: 0.0 - thres : 0.1
700
+ obj score: 0.44535166 - confidence: 0.0 - thres : 0.1
701
+ obj score: 0.8839524 - confidence: 0.0 - thres : 0.1
702
+ obj score: 0.94441986 - confidence: 0.0 - thres : 0.1
703
+ obj score: 0.6134788 - confidence: 0.0 - thres : 0.1
704
+ obj score: 0.13275604 - confidence: 0.0 - thres : 0.1
705
+ out.shape : (2028, 3170)
706
+ out.shape : (8112, 3170)
707
+ [{"x": 73, "framewidth": 724, "ClassName": "바게트빵", "w": 471, "ClassID": "A020112", "h": 384, "frameheight": 425, "y": -15}]
708
+ elapsed time: 1.4610087871551514
709
+ 1
710
+ out.shape : (507, 3170)
711
+ obj score: 0.671354 - confidence: 0.0 - thres : 0.1
712
+ obj score: 0.86670345 - confidence: 0.3784275 - thres : 0.1
713
+ obj score: 0.8751435 - confidence: 0.73969567 - thres : 0.1
714
+ obj score: 0.98907405 - confidence: 0.0 - thres : 0.1
715
+ obj score: 0.5332565 - confidence: 0.0 - thres : 0.1
716
+ obj score: 0.8822033 - confidence: 0.0 - thres : 0.1
717
+ obj score: 0.9876573 - confidence: 0.0 - thres : 0.1
718
+ obj score: 0.51913065 - confidence: 0.0 - thres : 0.1
719
+ obj score: 0.20261386 - confidence: 0.0 - thres : 0.1
720
+ out.shape : (2028, 3170)
721
+ out.shape : (8112, 3170)
722
+ [{"x": 68, "framewidth": 585, "ClassName": "미나리", "w": 388, "ClassID": "A260119", "h": 362, "frameheight": 460, "y": 54}]
723
+ elapsed time: 1.5096111297607422
724
+ 1
725
+ out.shape : (507, 3170)
726
+ obj score: 0.13031147 - confidence: 0.0 - thres : 0.1
727
+ obj score: 0.25829256 - confidence: 0.0 - thres : 0.1
728
+ obj score: 0.94687736 - confidence: 0.65943855 - thres : 0.1
729
+ obj score: 0.7907321 - confidence: 0.0 - thres : 0.1
730
+ obj score: 0.9064267 - confidence: 0.0 - thres : 0.1
731
+ obj score: 0.80411166 - confidence: 0.0 - thres : 0.1
732
+ obj score: 0.8483185 - confidence: 0.5794998 - thres : 0.1
733
+ obj score: 0.4439966 - confidence: 0.0 - thres : 0.1
734
+ obj score: 0.89004517 - confidence: 0.0 - thres : 0.1
735
+ obj score: 0.42231804 - confidence: 0.0 - thres : 0.1
736
+ obj score: 0.198893 - confidence: 0.0 - thres : 0.1
737
+ obj score: 0.19763796 - confidence: 0.0 - thres : 0.1
738
+ out.shape : (2028, 3170)
739
+ out.shape : (8112, 3170)
740
+ [{"x": 33, "framewidth": 206, "ClassName": "참나물", "w": 106, "ClassID": "A260147", "h": 201, "frameheight": 253, "y": -10}]
741
+ elapsed time: 1.4123897552490234
742
+ 1
743
+ out.shape : (507, 3170)
744
+ obj score: 0.8741836 - confidence: 0.8735819 - thres : 0.1
745
+ out.shape : (2028, 3170)
746
+ obj score: 0.11526003 - confidence: 0.0 - thres : 0.1
747
+ obj score: 0.1949244 - confidence: 0.0 - thres : 0.1
748
+ out.shape : (8112, 3170)
749
+ [{"x": 924, "framewidth": 2449, "ClassName": "쑥개떡", "w": 556, "ClassID": "A240213", "h": 450, "frameheight": 1633, "y": 605}]
750
+ elapsed time: 1.184636116027832
751
+ 1
752
+ out.shape : (507, 3170)
753
+ obj score: 0.8741836 - confidence: 0.8735819 - thres : 0.1
754
+ out.shape : (2028, 3170)
755
+ obj score: 0.11526003 - confidence: 0.0 - thres : 0.1
756
+ obj score: 0.1949244 - confidence: 0.0 - thres : 0.1
757
+ out.shape : (8112, 3170)
758
+ [{"x": 924, "framewidth": 2449, "ClassName": "쑥개떡", "w": 556, "ClassID": "A240213", "h": 450, "frameheight": 1633, "y": 605}]
759
+ elapsed time: 1.4734368324279785
760
+ 1
761
+ out.shape : (507, 3170)
762
+ obj score: 0.8741836 - confidence: 0.8735819 - thres : 0.1
763
+ out.shape : (2028, 3170)
764
+ obj score: 0.11526003 - confidence: 0.0 - thres : 0.1
765
+ obj score: 0.1949244 - confidence: 0.0 - thres : 0.1
766
+ out.shape : (8112, 3170)
767
+ [{"x": 924, "framewidth": 2449, "ClassName": "쑥개떡", "w": 556, "ClassID": "A240213", "h": 450, "frameheight": 1633, "y": 605}]118.67.133.131 - - [25/Feb/2021 22:47:01] "POST /uploader HTTP/1.1" 200 -
768
+ 118.67.133.131 - - [25/Feb/2021 22:53:48] "POST /uploader HTTP/1.1" 200 -
769
+ 118.67.133.131 - - [25/Feb/2021 23:21:23] "POST /uploader HTTP/1.1" 200 -
770
+ 118.67.133.131 - - [26/Feb/2021 08:10:21] "POST /uploader HTTP/1.1" 200 -
771
+ 118.67.133.131 - - [26/Feb/2021 08:46:37] "POST /uploader HTTP/1.1" 200 -
772
+ 118.67.133.131 - - [26/Feb/2021 10:51:34] "POST /uploader HTTP/1.1" 200 -
773
+ 118.67.133.131 - - [26/Feb/2021 10:52:28] "POST /uploader HTTP/1.1" 200 -
774
+ 118.67.133.131 - - [26/Feb/2021 10:54:33] "POST /uploader HTTP/1.1" 200 -
775
+ 118.67.133.131 - - [26/Feb/2021 10:54:46] "POST /uploader HTTP/1.1" 200 -
776
+ 118.67.133.131 - - [26/Feb/2021 10:55:04] "POST /uploader HTTP/1.1" 200 -
777
+ 118.67.133.131 - - [26/Feb/2021 11:21:01] "POST /uploader HTTP/1.1" 200 -
778
+ 118.67.133.131 - - [26/Feb/2021 11:21:11] "POST /uploader HTTP/1.1" 200 -
779
+ 118.67.133.131 - - [26/Feb/2021 11:43:02] "POST /uploader HTTP/1.1" 200 -
780
+ 141.98.10.149 - - [27/Feb/2021 01:16:36] code 400, message Bad HTTP/0.9 request type ('\x03\x00\x00/*à\x00\x00\x00\x00\x00Cookie:')
781
+ 141.98.10.149 - - [27/Feb/2021 01:16:36] "/*àCookie: mstshash=Administr" HTTPStatus.BAD_REQUEST -
config/.DS_Store ADDED
Binary file (6.15 kB). View file
 
config/__pycache__/config.cpython-310.pyc ADDED
Binary file (703 Bytes). View file
 
config/__pycache__/config.cpython-35.pyc ADDED
Binary file (807 Bytes). View file
 
config/__pycache__/config.cpython-39.pyc ADDED
Binary file (701 Bytes). View file
 
config/config.py ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # no package for independent configuration management
2
+
3
+ # Initialize the parameters
4
+ CONF_THRES = 0.1 #0.5 # Confidence threshold
5
+ NMS_THRES = 0.1 #0.4 # Non-maximum suppression threshold
6
+
7
+ INPWIDTH = 416 # 32*10 # 608 #Width of network's input image # 320(32*10)
8
+ INPHEIGHT = 416 #32*9 # 608 #Height of network's input image # 288(32*9) best
9
+
10
+ # start video frame number
11
+ Video_Start_Frame = (21-4)*60*30+(2-39)*30 # compute the first starting location from a video
12
+
13
+ # model base dir
14
+ #ModelBaseDir = "C:/Users/mmc/workspace/AI_core/food_classification/yolo"
15
+ ModelBaseDir = "./yolo"
16
+ TEST_IMAGE_PATH ="/home/rtdatum/workspace/food_classification/images_rec/13118.jpg"
17
+ #TEST_IMAGE_PATH ="C:/Users/mmc/workspace/AI_core/food_classification/yolo/data/쑥개떡/A240213_111121_0005.jpg"
18
+ #TEST_IMAGE_PATH ="./yolo/data/food/images/A270309_111112_0002.jpg"
19
+ TEST_VIDEO_PATH = \
20
+ ""#"E:/Topes_data_related/시나리오 영상/시나리오 영상/20200909PM/6085-20200909-170439-1599638679.mp4"
21
+ SHOW_TEXT_FLAG = 1
22
+ PS_FLAG = 1
23
+
24
+ # Load names of classes, please don't include the first directory separator like "/data/..."
25
+ CLASSES_FILE = "data/food/food-classes.names"
26
+ CLASSES_FILE_CODE = "data/food/food-classes.codes"
27
+
28
+ # Give the configuration and weight files for the model and load the network using them.
29
+ # Don't include the first directory separator
30
+ # -- yolov3 ------
31
+ # ------- 3 layers
32
+ # itms
33
+ # Model_Configuration = "config/itms-dark-yolov3-tiny_3l-v3-2.cfg"
34
+ # Model_Weights = "data/food/weights/itms-dark-yolov3-tiny_3l-v3-2_200000.weights"
35
+ # food
36
+ Model_Configuration = "config/food-dark-yolov3-tiny_3l-v3-2.cfg"
37
+ Model_Weights = "data/food/weights/food-dark-yolov3-tiny_3l-v3-2_24000.weights"
38
+ # ------- full layers
39
+ #Model_Configuration = "config/food-dark-yolov3-full-2.cfg"
40
+ # Model_Weights = "data/food/weights/food-dark-yolov3-full-2_100000.weights"
41
+ # -- yolov4 -------
42
+ # 3l layers
43
+ # Model_Configuration = "config/food-dark-yolov4-tiny-3l-v1.cfg"
44
+ # Model_Weights = "data/food/weights/food-dark-yolov4-tiny-3l-v1_best.weights"
45
+ # full layers
46
+ # Model_Configuration = "config/food-dark-yolov4-full.cfg"
47
+ # Model_Weights = "data/food/weights/food-dark-yolov4-full_10000.weights"
48
+
font/gulim.ttc ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4b9ac63e8920ed1bae29c068025ed30493464c18ee18617887daa18e59189226
3
+ size 13531200
food_classifier_UI_v099.py ADDED
@@ -0,0 +1,250 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import cv2
2
+ import numpy as np
3
+ import glob
4
+ import random
5
+ import pathlib
6
+ import subprocess, os
7
+ from PIL import Image
8
+ # import matplotlib.pyplot as plt
9
+
10
+ CONF_THRES = 0.1 #0.5 # Confidence threshold
11
+ NMS_THRES = 0.1 #0.4 # Non-maximum suppression threshold
12
+
13
+ INPWIDTH = 32*10 # 608 #Width of network's input image # 320(32*10)
14
+ INPHEIGHT = 32*9 # 608 #Height of network's input image # 288(32*9) best
15
+
16
+ #ui
17
+ import cv2
18
+ from tkinter import *
19
+ from tkinter import messagebox
20
+ from tkinter import filedialog
21
+ from tkinter.ttk import Button, Style, Progressbar
22
+ import time
23
+ import os
24
+
25
+ folder_selected=""
26
+ class_name=""
27
+ data_class=""
28
+ v_class=""
29
+
30
+ def add_class():
31
+ data_class = add_class_field.get()
32
+ class_name = data_class
33
+ if data_class == "":
34
+ messagebox.showinfo("Warning!!", "Class cant be empty")
35
+ else:
36
+ print("===============Class Name================")
37
+ print(class_name)
38
+ v_class=class_name
39
+ main()
40
+
41
+
42
+ # Load Yolo
43
+ def main():
44
+ folder_selected = filedialog.askdirectory()
45
+ v_class =add_class_field.get()
46
+ print("=========================class name===================")
47
+ print(v_class)
48
+ print(folder_selected)
49
+ print( "========================================")
50
+ # label_file_explorer.configure(text="File Path: "+folder_selected)
51
+ # sangkny
52
+ # original net = cv2.dnn.readNet("yolov3_training_2000.weights", "yolov3_testing.cfg")
53
+ #modelBaseDir = "C:/Users/mmc/workspace/yolo"
54
+ modelBaseDir = "./yolo"
55
+ modelConfiguration = modelBaseDir + "/config/food-dark-yolov3-tiny_3l-v3-2.cfg"
56
+ modelWeights = modelBaseDir + "/data/food/weights/food-dark-yolov3-tiny_3l-v3-2_200000.weights"
57
+ net = cv2.dnn.readNetFromDarknet(modelConfiguration, modelWeights)
58
+ #
59
+
60
+ # Name custom object
61
+ # classes = [" "]
62
+ # Load names of classes by sangkny
63
+ classesFile = modelBaseDir + "/data/food/food-classes.names"
64
+ classes = None
65
+ with open(classesFile, 'rt') as f:
66
+ classes = f.read().rstrip('\n').split('\n')
67
+
68
+
69
+ #path for train
70
+ train_path = glob.glob(
71
+ r"" +folder_selected)
72
+ # Images path
73
+ images_path = glob.glob(
74
+ r"" +folder_selected+"\*.jpg")
75
+ layer_names = net.getLayerNames()
76
+
77
+ output_layers = [layer_names[i[0] - 1] for i in net.getUnconnectedOutLayers()]
78
+ colors = np.random.uniform(0, 255, size=(len(classes), 3))
79
+ for img_path in images_path:
80
+ # Loading image
81
+ print(img_path)
82
+ img = cv2.imread(img_path)
83
+ file_name = img_path.rsplit('\\', 1)[1]
84
+ file_name = file_name.rsplit('.', 1)[0]
85
+ print (file_name)
86
+ img = cv2.resize(img, None, fx=0.7, fy=0.7)
87
+ height, width, channels = img.shape
88
+
89
+ # Detecting objects
90
+ # blob = cv2.dnn.blobFromImage(frame, 1 / 255, (inpWidth, inpHeight), [0, 0, 0], 1, crop=False)
91
+ blob = cv2.dnn.blobFromImage(img, 0.00392, (INPWIDTH, INPHEIGHT), (0, 0, 0), True, crop=False)
92
+
93
+ net.setInput(blob)
94
+ outs = net.forward(output_layers)
95
+
96
+ # Showing informations on the screen
97
+ class_ids = []
98
+ confidences = []
99
+ boxes = []
100
+ boxes2 = []
101
+ coordinate_list = [] # for .txt
102
+
103
+ for out in outs:
104
+ for detection in out:
105
+ scores = detection[5:]
106
+ class_id = np.argmax(scores)
107
+ confidence = scores[class_id]
108
+ if confidence > CONF_THRES:
109
+ # Object detected
110
+ # print("NonArr", class_id)
111
+ center_x = int(detection[0] * width)
112
+ center_y = int(detection[1] * height)
113
+ w = int(detection[2] * width)
114
+ h = int(detection[3] * height)
115
+ a = class_id
116
+ b = detection[0]
117
+ c = detection[1]
118
+ d = detection[2]
119
+ e = detection[3]
120
+ print("=====================")
121
+ print(a,b,c,d,e,confidence)
122
+
123
+ # Rectangle coordinates
124
+ x = int(center_x - w / 2)
125
+ y = int(center_y - h / 2)
126
+
127
+ boxes.append([x, y, w, h])
128
+ boxes2.append([a, b, c, d,e])
129
+ confidences.append(float(confidence))
130
+ class_ids.append(class_id)
131
+
132
+ coordinate = class_id, detection[0], detection[1], detection[2], detection[3], "Confidence:", confidence
133
+
134
+ coordinate_for_txt = class_id, detection[0], detection[1], detection[3], detection[4]
135
+ coordinate_list.append(coordinate_for_txt)
136
+
137
+ font = cv2.FONT_HERSHEY_PLAIN
138
+ indexes = cv2.dnn.NMSBoxes(boxes, confidences, 0.5, 0.4)
139
+ filename = os.path.basename(img_path).replace('.jpg', '')
140
+ print("========================All Coordinate=====================")
141
+ # print(coordinate_to_str)
142
+ #coordinate.txt
143
+ with open("result/obj_train_data/%s.txt" %filename, "w") as file: #for .txt
144
+ for i in range(len(boxes)):
145
+ if i in indexes:
146
+ x, y, w, h = boxes[i]
147
+ label = str(classes[class_ids[i]])
148
+ color = colors[class_ids[i]]
149
+ cv2.rectangle(img, (x, y), (x + w, y + h), color, 2)
150
+ cv2.putText(img, label, (x, y + 30), font, 3, color, 2)
151
+ a, b, c, d, e =boxes2[i]
152
+ ab = a, b, c, d, e, confidence
153
+ print("=========================Choosen Coordinate=======================")
154
+ print(ab)
155
+ printout = str(a)+" "+ str(b)+" "+ str(c)+" "+ str(d)+" "+ str(e)+ "\n"
156
+ file.write(printout)
157
+
158
+ cv2.imshow('result image', img)
159
+ cv2.waitKey(0)
160
+ #train data
161
+ path = folder_selected
162
+ listdir = os.listdir(path)
163
+
164
+ with open("result/train.txt", "w") as train:
165
+ for file in listdir:
166
+ train.writelines("data/obj_train_data/"+file+"\n")
167
+
168
+ print("Arr", indexes)
169
+ print("========================End============================")
170
+
171
+ #.names
172
+ with open("result/obj.names", "w") as names:
173
+ names.write(v_class)
174
+
175
+ #.data
176
+ with open("result/obj.data", "w") as data:
177
+ data_content = "classes = "+ "1" + "\n" + "train = data/train.txt" + "\n" + "names = data/obj.names" + "\n" + "backup = backup/" + "\n"
178
+ data.write(data_content)
179
+ messagebox.showinfo("Notif", "Process Completed")
180
+
181
+ root = Tk()
182
+ root.geometry("800x300")
183
+ root.title('SVG Auto Annonate v0.99')
184
+
185
+ def bar():
186
+ # progress.start(20)
187
+ print("============Browse File=============")
188
+ # print(printed)
189
+
190
+ def execute():
191
+ main()
192
+
193
+ s = Style()
194
+ # path_frame = Frame(root, bg='blue')
195
+ # path_frame.pack(side=TOP)
196
+
197
+ field_frame = Frame(root)
198
+ field_frame.pack(pady=20)
199
+
200
+ # add_class_btn_frame = Frame(root)
201
+ # add_class_btn_frame.pack(pady=10)
202
+
203
+ btn_group_frame = LabelFrame(root, padx=10, pady=10)
204
+ btn_group_frame.pack(pady=20)
205
+
206
+ execute_info_frame = LabelFrame(root, text="Execution Progress", padx=10, pady=10)
207
+ execute_info_frame.pack(pady=20)
208
+
209
+ exit_btn_frame = Frame(root)
210
+ execute_info_frame.pack(side=BOTTOM)
211
+
212
+ # label_file_explorer = Label(path_frame,
213
+ # text = "Path . . . .",
214
+ # width = 70, height = 2,
215
+ # fg = "blue", bg="snow")
216
+
217
+ field_label = Label(field_frame, text="Class")
218
+ add_class_field = Entry(field_frame)
219
+
220
+ # add_class_btn = Button(add_class_btn_frame, text="Add Class", command=add_class)
221
+
222
+ btn_execute = Button(btn_group_frame, text="Browse and Execute", width=25, style='execute_btn.TButton', command=add_class)
223
+ # btn_cancel = Button(btn_group_frame, text="Cancel", width=25, style='cancel_btn.TButton')
224
+
225
+ # progress = Progressbar(execute_info_frame, length=400 ,mode='indeterminate', orient=HORIZONTAL)
226
+
227
+ # exit_btn = Button(exit_btn_frame, text="Quit", width=30)
228
+
229
+ # specifying rows and columns
230
+ # label_file_explorer.grid(column=0, row=0)
231
+
232
+ btn_execute.grid(column=0, row=1)
233
+
234
+ field_label.grid(column=0, row=2, padx=15)
235
+ add_class_field.grid(column=1, row=2)
236
+
237
+ # btn_cancel.grid(column=1, row=0, padx=15)
238
+
239
+ # progress.grid(column=0, row=0)
240
+
241
+ #style
242
+ s.configure('execute_btn.TButton', background='blue')
243
+ # s.configure('cancel_btn.TButton', background='red')
244
+
245
+
246
+ # show_img = cv2.imshow("Deteksi Gambar Balon", img)
247
+ # key = cv2.waitKey(0)
248
+
249
+ root.mainloop()
250
+ # cv2.destroyAllWindows()
food_classifier_yolo.py ADDED
@@ -0,0 +1,279 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- encoding: utf-8 -*-
2
+ # ---------------------------- Food Classifier ---------------------------
3
+ # This code is written to test the food classifier using customized YOLO model
4
+ # It supports YOLO v3 and v4 as of 20Dec. 11, 2020
5
+ # For options in detail, please refer to /config/confi.py
6
+
7
+ # Usage example: python3 food_classifier_yolo.py --video=run.mp4
8
+ # python3 food_classifier_yolo.py --image=bird.jpg
9
+ # -------------------------------------------------------------------------
10
+ # modified by speedpointer, 05 Aug, 2025
11
+
12
+ import os.path
13
+ import cv2 as cv
14
+ import argparse
15
+ import sys
16
+ import numpy as np
17
+ import json
18
+ from PIL import ImageFont, ImageDraw, Image
19
+
20
+ from config import config
21
+
22
+ parser = argparse.ArgumentParser(description='Food Classification and Localization ver. 0.9')
23
+ parser.add_argument('--image', help='Full path to image file.')
24
+ parser.add_argument('--video', help='Full path to video file.')
25
+ parser.add_argument('--showText', type=int, default=1, help='show text in the output.')
26
+ parser.add_argument('--ps', type=int, default=1, help='stop each image in the screen.')
27
+ args = parser.parse_args()
28
+
29
+ # Initialize the parameters
30
+ args.image = config.TEST_IMAGE_PATH # image path
31
+ args.video = config.TEST_VIDEO_PATH # video path
32
+ args.showText = config.SHOW_TEXT_FLAG #1
33
+ args.ps = config.PS_FLAG # 1
34
+
35
+ # refine the inferences
36
+ confThreshold = config.CONF_THRES # 0.1 #0.5 # Confidence threshold
37
+ nmsThreshold = config.NMS_THRES #0.1 #0.4 # Non-maximum suppression threshold
38
+
39
+ # modes inference size regardless of input image size
40
+ inpWidth = config.INPWIDTH # 32*10 # 608 #Width of network's input image # 320(32*10)
41
+ inpHeight = config.INPHEIGHT # 32*9 # 608 #Height of network's input image # 288(32*9) best
42
+
43
+ # model base directory
44
+ modelBaseDir = config.ModelBaseDir # "C:/Users/mmc/workspace/yolo"
45
+
46
+ # Load names of classes from a file
47
+ classesFile = os.path.sep.join([modelBaseDir, config.CLASSES_FILE])
48
+ classes = None
49
+ with open(classesFile, 'rt', encoding='utf-8') as f:
50
+ classes = f.read().rstrip('\n').split('\n')
51
+
52
+ # Load codes of classes from a file
53
+ classes_File_Codes = os.path.sep.join([modelBaseDir, config.CLASSES_FILE_CODE])
54
+ classes_codes = None
55
+ with open(classes_File_Codes, 'rt', encoding='utf-8') as f:
56
+ classes_codes = f.read().rstrip('\n').split('\n')
57
+
58
+ assert (len(classes) == len(classes_codes))
59
+
60
+ # model configuration and weights paths
61
+ modelConfiguration = os.path.sep.join([modelBaseDir, config.Model_Configuration])
62
+ modelWeights = os.path.sep.join([modelBaseDir, config.Model_Weights])
63
+
64
+ # load a given model
65
+ net = cv.dnn.readNetFromDarknet(modelConfiguration, modelWeights)
66
+ net.setPreferableBackend(cv.dnn.DNN_BACKEND_OPENCV)
67
+ net.setPreferableTarget(cv.dnn.DNN_TARGET_OPENCL_FP16)
68
+
69
+ # Get the names of the output layers
70
+ def getOutputsNames(net):
71
+ # Get the names of all the layers in the network
72
+ layersNames = net.getLayerNames()
73
+ # Get the names of the output layers, i.e. the layers with unconnected outputs
74
+ # Fix for OpenCV 4.x compatibility
75
+ unconnected = net.getUnconnectedOutLayers()
76
+ if len(unconnected.shape) == 1:
77
+ return [layersNames[i - 1] for i in unconnected]
78
+ else:
79
+ return [layersNames[i[0] - 1] for i in unconnected]
80
+
81
+ # Draw the predicted bounding box
82
+ def drawPred(frame, classId, conf, left, top, right, bottom):
83
+ # Draw a bounding box.
84
+ # cv.rectangle(frame, (left, top), (right, bottom), (255, 178, 50), 3)
85
+ cv.rectangle(frame, (left, top), (right, bottom), (0, 255, 0), 3)
86
+
87
+ label = '%.2f' % conf
88
+
89
+ # Get the label for the class name and its confidence
90
+ if classes:
91
+ assert (classId < len(classes))
92
+ #label = '%s:%s' % (classes[classId], label)
93
+ label = u'%s' % (classes[classId])
94
+ #label = u'%s' % (classId)
95
+ print('label:{}, class_id:{}'.format(label, classId))
96
+
97
+
98
+ # Display the label at the top of the bounding box
99
+ labelSize, baseLine = cv.getTextSize(label, cv.FONT_HERSHEY_SIMPLEX, 0.5, 1)
100
+ top = max(top, labelSize[1])
101
+ if args.showText:
102
+ #cv.rectangle(frame, (left, top - round(1.5 * labelSize[1])), (left + round(1.5 * labelSize[0]), top + baseLine),
103
+ # (0, 255, 255), cv.FILLED)
104
+ cv.rectangle(frame, (left, top - round(1.5*labelSize[1])), (left + round(1.5*labelSize[0]), top + baseLine), (0, 255, 255), cv.FILLED)
105
+ cv.putText(frame, label, (left, top), cv.FONT_HERSHEY_SIMPLEX, 0.75, (0, 0, 0), 2)
106
+
107
+ #fontpath = "./font/gulim.ttc"
108
+ #font_ = ImageFont.truetype(fontpath, 14)
109
+ #img_pil = Image.fromarray(frame)
110
+ #draw = ImageDraw.Draw(img_pil)
111
+ #draw.text((left, top), label, font=font_, fill=(0, 0, 0, 0))
112
+ #frame = np.array(img_pil)
113
+ #cv.imshow('pil', frame)
114
+
115
+
116
+ def postprocess(frame, outs, showimg=False):
117
+ frameHeight = frame.shape[0]
118
+ frameWidth = frame.shape[1]
119
+
120
+ # Scan through all the bounding boxes output from the network and keep only the
121
+ # ones with high confidence scores. Assign the box's class label as the class with the highest score.
122
+ classIds = []
123
+ confidences = []
124
+ boxes = []
125
+ for out in outs:
126
+ if(args.showText):
127
+ print("out.shape : ", out.shape)
128
+ for detection in out:
129
+ # if detection[4]>0.001:
130
+ scores = detection[5:]
131
+ classId = np.argmax(scores)
132
+ # if scores[classId]>confThreshold:
133
+ confidence = scores[classId]
134
+ if detection[4] >= confThreshold:
135
+ if(args.showText):
136
+ print('obj score: ', detection[4], " - confidence:", scores[classId], " - thres : ", confThreshold)
137
+ #print(detection)
138
+ if confidence >= confThreshold:
139
+ center_x = int(detection[0] * frameWidth)
140
+ center_y = int(detection[1] * frameHeight)
141
+ width = int(detection[2] * frameWidth)
142
+ height = int(detection[3] * frameHeight)
143
+ left = int(center_x - width / 2)
144
+ top = int(center_y - height / 2)
145
+ classIds.append(classId)
146
+ confidences.append(float(confidence))
147
+ boxes.append([left, top, width, height])
148
+ # cv.rectangle(frame, (left, top), (left+width, top+height), (255, 0, 255),2)
149
+ # cv.imshow('test', frame)
150
+ # cv.waitKey(1)
151
+
152
+ # Perform non maximum suppression to eliminate redundant overlapping boxes with
153
+ # lower confidences.
154
+ indices = cv.dnn.NMSBoxes(boxes, confidences, confThreshold, nmsThreshold)
155
+ rests =[]
156
+ for i in indices:
157
+ # Fix for OpenCV 4.x compatibility
158
+ idx = i[0] if isinstance(i, (list, tuple, np.ndarray)) and len(i) > 0 else i
159
+ box = boxes[idx]
160
+ left = box[0]
161
+ top = box[1]
162
+ width = box[2]
163
+ height = box[3]
164
+ rests.append([classIds[idx], left, top, width, height, frameWidth, frameHeight])
165
+ if(showimg):
166
+ drawPred(frame, classIds[idx], confidences[idx], left, top, left + width, top + height)
167
+
168
+ return rests
169
+
170
+ def food_classifier_Json(image):
171
+ # do somthing
172
+ print(args.showText)
173
+ locations = food_classifier_pipeline(frame=image) #[(2321, 0, 0, 10, 10)] # list of (id, rect) from classfication
174
+ jsons = []
175
+ for j,location in enumerate(locations):
176
+ class_id, x, y, width, height, framewidth, frameheight =location
177
+ res_json = {}
178
+ res_json["ClassID"] = classes_codes[class_id] # code , class_id (training class)
179
+ res_json["ClassName"] = classes[class_id]
180
+ res_json["x"] = int(x)
181
+ res_json["y"] = int(y)
182
+ res_json["w"] = int(width)
183
+ res_json["h"] = int(height)
184
+ res_json["framewidth"] = int(framewidth)
185
+ res_json["frameheight"]= int(frameheight)
186
+ jsons.append(res_json)
187
+ print(json.dumps(jsons,ensure_ascii=False))
188
+
189
+ return json.dumps(jsons,ensure_ascii=False)
190
+
191
+ def food_classifier_pipeline(frame):
192
+
193
+ # Create a 4D blob from a frame.
194
+ blob = cv.dnn.blobFromImage(frame, 1 / 255, (inpWidth, inpHeight), [0, 0, 0], 1, crop=False)
195
+ # Sets the input to the network
196
+ net.setInput(blob)
197
+ # Runs the forward pass to get output of the output layers
198
+ outs = net.forward(getOutputsNames(net))
199
+ final_infos = postprocess(frame, outs)
200
+
201
+ return final_infos
202
+
203
+ # Process inputs
204
+ def main(main_args):
205
+ winName = 'Food Classification Results'
206
+ #cv.namedWindow(winName, cv.WINDOW_AUTOSIZE)
207
+ m_startFrame = np.maximum(0, config.Video_Start_Frame)
208
+
209
+ outputFile = "yolo_out_py.avi"
210
+ if (main_args.image):
211
+ # Open the image file
212
+ if not os.path.isfile(main_args.image):
213
+ print("Input image file ", main_args.image, " doesn't exist")
214
+ sys.exit(1)
215
+ cap = cv.VideoCapture(main_args.image)
216
+ outputFile = args.image[:-4] + '_yolo_out_py.jpg'
217
+ elif (main_args.video):
218
+ # Open the video file
219
+ if not os.path.isfile(main_args.video):
220
+ print("Input video file ", main_args.video, " doesn't exist")
221
+ sys.exit(1)
222
+ cap = cv.VideoCapture(main_args.video)
223
+ cap.set(cv.CAP_PROP_POS_FRAMES, m_startFrame)
224
+ outputFile = main_args.video[:-4] + '_yolo_out_py.avi'
225
+ else:
226
+ # Webcam input
227
+ cap = cv.VideoCapture(0)
228
+
229
+ # Get the video writer initialized to save the output video
230
+ if (not main_args.image):
231
+ vid_writer = cv.VideoWriter(outputFile, cv.VideoWriter_fourcc('M', 'J', 'P', 'G'), 30,
232
+ (round(cap.get(cv.CAP_PROP_FRAME_WIDTH)), round(cap.get(cv.CAP_PROP_FRAME_HEIGHT))))
233
+ pcontinue = True
234
+ while pcontinue:
235
+
236
+ # get frame from the video
237
+ hasFrame, frame = cap.read()
238
+
239
+ # Stop the program if reached end of video
240
+ if not hasFrame:
241
+ print("Done processing !!!")
242
+ print("Output file is stored as ", outputFile)
243
+ # if(main_args.ps):
244
+ # cv.waitKey(0)
245
+ #else:
246
+ # cv.waitKey(1)
247
+
248
+ #break
249
+
250
+ # Create a 4D blob from a frame.
251
+ blob = cv.dnn.blobFromImage(frame, 1 / 255, (inpWidth, inpHeight), [0, 0, 0], 1, crop=False)
252
+ # Sets the input to the network
253
+ net.setInput(blob)
254
+ # Runs the forward pass to get output of the output layers
255
+ outs = net.forward(getOutputsNames(net))
256
+ if main_args.showText:
257
+ print(getOutputsNames(net))
258
+
259
+ postprocess(frame, outs, showimg=True)
260
+
261
+ # Put efficiency information. The function getPerfProfile returns the overall time for inference(t) and the timings for each of the layers(in layersTimes)
262
+ if main_args.showText:
263
+ t, _ = net.getPerfProfile()
264
+ label = 'Inference time: %.2f ms' % (t * 1000.0 / cv.getTickFrequency())
265
+ print(label)
266
+ cv.putText(frame, label, (0, 15), cv.FONT_HERSHEY_SIMPLEX, 0.5, (0, 0, 255))
267
+
268
+ # Write the frame with the detection boxes
269
+ if (main_args.image):
270
+ cv.imwrite(outputFile, frame.astype(np.uint8));
271
+ else:
272
+ vid_writer.write(frame.astype(np.uint8))
273
+
274
+ #cv.imshow(winName, frame)
275
+ #cv.waitKey(1)
276
+ pcontinue=False
277
+
278
+ if __name__ == "__main__":
279
+ main(main_args=args)
images_rec/-LcmZOV4xrQVjv61hX2yF.jpeg ADDED

Git LFS Details

  • SHA256: 77602490434ec7ce247958834d5c3e796a5c944a170c66d51ca78c8bac7c98a7
  • Pointer size: 132 Bytes
  • Size of remote file: 1.46 MB
images_rec/-h6zaExAO5d0SwOLab4CD.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:61b83852c206e82aeda78fb4d64d72a357d9a272fc7a509f08de959b3ec78daa
3
+ size 5478482
images_rec/0G5lzNC9wlMjLH4Pgqpiv.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:44b1a55c7f3281b73dbbb5ac248881835727206721abdaeaf812d6f235f70167
3
+ size 191375
images_rec/0Wu-eggp4JBICAoABliTc.jpeg ADDED

Git LFS Details

  • SHA256: 77602490434ec7ce247958834d5c3e796a5c944a170c66d51ca78c8bac7c98a7
  • Pointer size: 132 Bytes
  • Size of remote file: 1.46 MB
images_rec/0xSnz-Yn6dc9yB8eQgzeP.jpeg ADDED

Git LFS Details

  • SHA256: 77602490434ec7ce247958834d5c3e796a5c944a170c66d51ca78c8bac7c98a7
  • Pointer size: 132 Bytes
  • Size of remote file: 1.46 MB
images_rec/13.jpg ADDED

Git LFS Details

  • SHA256: a6f8fc5782f396745689271245eea0002a836430c837039cca37400f51e77491
  • Pointer size: 131 Bytes
  • Size of remote file: 302 kB
images_rec/13118.jpg ADDED
images_rec/13118_yolo_out_py.jpg ADDED
images_rec/13121.jpg ADDED

Git LFS Details

  • SHA256: c09ab21226861091b3d3e0d5129cdaab60d9ce6961d3e44edd756c430654ceee
  • Pointer size: 131 Bytes
  • Size of remote file: 159 kB
images_rec/19.jpg ADDED

Git LFS Details

  • SHA256: 6101a7fb7015f19e6b89187bf29cb0c8f6d48b517be24cc5b90634d8e43db2e0
  • Pointer size: 131 Bytes
  • Size of remote file: 177 kB
images_rec/1cnIS16DmJFYH5xGdZDVp.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:77602490434ec7ce247958834d5c3e796a5c944a170c66d51ca78c8bac7c98a7
3
+ size 1459594
images_rec/1jEP7XVqK_qxMGFELEcBd.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:44b1a55c7f3281b73dbbb5ac248881835727206721abdaeaf812d6f235f70167
3
+ size 191375
images_rec/22.jpg ADDED

Git LFS Details

  • SHA256: fb9053fb7a9410a7578004c6e0006e9f547b44f2ca05101c6b39a8d6e179a865
  • Pointer size: 131 Bytes
  • Size of remote file: 162 kB
images_rec/2ZBNwnbnYNpcLL9aBUS4w.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f86344dd3134033330bc9ab92b06c45df6c5714462301443665a6a7edd701373
3
+ size 2936393
images_rec/34gFMj0jKceCkDDHW9H4k.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a76b1364719285bdb60ba26e1a0e83f5c278105301fd2a7668dcdf8c841ce5ba
3
+ size 5129949
images_rec/390XJDGATbmhPazLWOBc6.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:77602490434ec7ce247958834d5c3e796a5c944a170c66d51ca78c8bac7c98a7
3
+ size 1459594
images_rec/3Jkl_BANLxoAJkkWodwKH.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:805bf4d64b839d964c8fba5cc3be99d9ac4e76929578acbd48ca8a3c073dfc19
3
+ size 4615403
images_rec/5L7QIIY8EYYhXCyHWUCFr.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:437d6a1f645f3a31f99c44a956d11d9276f35b2f99e2d0eb7ac67eafce5b2e2f
3
+ size 5157898
images_rec/7u5qmwKFsB-walZ34Oe4U.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f7a1ac7b47d023e7d7125f88e73961e9c977f58e70929f1317630991cbe43372
3
+ size 4578697
images_rec/8.jpg ADDED

Git LFS Details

  • SHA256: a3f07f0017b00f497b0992517e32d86dbac51bdbab6a615b13661914414270bb
  • Pointer size: 131 Bytes
  • Size of remote file: 193 kB
images_rec/88rGixQVT8KtfyK_Hq4fH.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2d663020fc8a05cfdc3c9348872192692beb2627359bd860c9c7f9235d3e81b4
3
+ size 4046352
images_rec/8Byi031_J7Dvvrw60jvTf.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7839fca13e0191b4c21e01dd52b39a30ed1b07cea3ae5ac1cbbd107ce22cbe7b
3
+ size 4521136
images_rec/911.jpg ADDED
images_rec/A020112_111114_0004.JPG ADDED

Git LFS Details

  • SHA256: 2459d642833712450fd3e43d6abded4047caa181cb29f1dfdb77383fcb83711a
  • Pointer size: 132 Bytes
  • Size of remote file: 1.05 MB
images_rec/A240208_111424_0032_enhanced.JPG.png ADDED

Git LFS Details

  • SHA256: 4b00d6544553e474934133c3319fd549bf6f669ff7f680c0cecb7c72ce83707d
  • Pointer size: 132 Bytes
  • Size of remote file: 4.44 MB
images_rec/A240213_111224_0020.JPG ADDED

Git LFS Details

  • SHA256: ffa7f52fe103daf84fa180e78f67ad5cbdfde8fff6197ddf8f2ac45f660fb79b
  • Pointer size: 131 Bytes
  • Size of remote file: 711 kB
images_rec/A250101_111212_0002.JPG ADDED

Git LFS Details

  • SHA256: b8683de6527f991a1f6e65c9dd0b7c5c971d4881fcc799ffe10303a4243c3eeb
  • Pointer size: 132 Bytes
  • Size of remote file: 1.42 MB
images_rec/A250101_111424_0032.JPG ADDED

Git LFS Details

  • SHA256: 77f7550cedf39346ba763f32ce8aa3c4bde0008b5fb9d3f7a0c2b39f3605369c
  • Pointer size: 131 Bytes
  • Size of remote file: 752 kB
images_rec/A260173_111124_0008.JPG ADDED

Git LFS Details

  • SHA256: a2c715591855199823b2503338ac33fe9d6e3e2d5c3f0e284851834bcd7b36e5
  • Pointer size: 131 Bytes
  • Size of remote file: 654 kB
images_rec/AisrTDiAbj0Y0w5qGpSp-.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d25f6843909654a3d9e16d5e62d24edf5658efc73f220a12c962631b23f327ba
3
+ size 3718151
images_rec/BhzWBe-ZI5ZFgAPzYL23h.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:77602490434ec7ce247958834d5c3e796a5c944a170c66d51ca78c8bac7c98a7
3
+ size 1459594
images_rec/Bk8E-bGn1i4DJIrzKXGW3.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:44b1a55c7f3281b73dbbb5ac248881835727206721abdaeaf812d6f235f70167
3
+ size 191375
images_rec/CVuwRcNm-ny33CMmLdIes.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:db85fa9122e8052970efd36eb25246bb3dc4919d553c8fde8f66f6b1e5cc5b1d
3
+ size 5163362
images_rec/DpBFo_IdI2MzmGFIi4q8b.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9a6ba2613ee5f5a0aa51b81d272667beb87810b05311c87db52b7592415d8249
3
+ size 3623474
images_rec/E7L6NErhRmI5K7NvwtIIv.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8ec0cd4d79338c6ba600b436618c21a1c427bd359bed1ff3c781c67420dfce40
3
+ size 1408858
images_rec/EFcHP3Y89VnQfwzzC12qu.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:44b1a55c7f3281b73dbbb5ac248881835727206721abdaeaf812d6f235f70167
3
+ size 191375
images_rec/Ex-6VCTPgtUYyFDCjI8Rp.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c1ad7a42829a623abcf8c31f0c18b94b4f4437f2b46691444d0de401eeb477cc
3
+ size 4913741
images_rec/F1Bv3_6KeZNbRl2NJZUmu.jpeg ADDED

Git LFS Details

  • SHA256: 77602490434ec7ce247958834d5c3e796a5c944a170c66d51ca78c8bac7c98a7
  • Pointer size: 132 Bytes
  • Size of remote file: 1.46 MB