
OCR Β(Optical Character Recognition)μ λ¬Έμ λ±μ μ΄λ―Έμ§μμ κΈμλ₯Ό μΈμνλ Task μ λλ€. OCRμ λͺ¨λλ‘λ κΈμ μμμ νλ¨νλ Text Detector, μμμ ν¬ν¨λ κΈμλ₯Ό μΈμνλ Text Recognizer, μμ°μ΄λ₯Ό μ μλ―Έν μμλ‘ μ λ ¬νλ Serializer, κΈ°μ μλ keyλ€μ λν value μΆμΆνλ Text Parserκ° μμ΅λλ€. ν΄λΉ λνλ μμμ¦ μ΄λ―Έμ§ λ°μ΄ν°μμ κΈμλ₯Ό κ²μΆνλ OCR λνλ‘ λ€μ λ κ°μ§ κ·μΉμ΄ μμ΅λλ€.
- μμμ¦ μ΄λ―Έμ§μμ μμμ νμ§νλ Text Detectionλ§μ μνν©λλ€.
- λͺ¨λΈμ EASTλ‘ κ³ μ νκ³ , Dataλ§μ μμ νμ¬ μ±λ₯μ λμ¬μΌ ν©λλ€.
λνλ μμ νμ§ μ±λ₯μ νκ°νλ DetEvalμ ν΅ν΄ νκ°λ©λλ€.
νλ‘μ νΈ μ 체 μΌμ
- 2024.10.30 ~ 2024.11.07
νλ‘μ νΈ μΈλΆμΌμ
- 2024.10.30 ~ 2024.10.31 : λ°μ΄ν° EDA λ° μκ°ν, νκ° μ§ν μ€μ
- 2024.10.30 ~ 2024.11.03 : Wandb μ°λ λ° λ‘κ·Έ μΆκ°
- 2024.11.01 ~ 2024.11.03 : μΈλΆ λ°μ΄ν° μ‘°μ¬ λ° Annotation κ°μ΄λλΌμΈ μ€μ
- 2024.11.02 ~ 2024.11.05 : μΈλΆ λ°μ΄ν° Annotation
- 2024.11.02 ~ 2024.11.07 : λͺ¨λΈ μ€ν λ° νκ°
- 2024.11.07 ~ 2024.11.08 : λͺ¨λΈ μμλΈ μ€ν
- 2024.11.08 ~ 2024.11.08 : μ΅μ’ λͺ¨λΈ νκ°
κ° νμ΄νλΌμΈμ λν μμΈν λ΄μ©μ μλ λ§ν¬λ₯Ό ν΅ν΄ νμΈν μ μμ΅λλ€.
- Wandb μ°λ
- λ°μ΄ν° EDA λ° Streamlit μκ°ν
- μΈλΆ λ°μ΄ν° μ‘°μ¬ λ° λ°μ΄ν° μ¦κ°
- λͺ¨λΈ μ€ν λ° νκ°
- λͺ¨λΈ μμλΈ μ€ν
Private 리λ보λμμ μ΅μ’
μ μΌλ‘ μλμ κ°μ κ²°κ³Όλ₯Ό μ»μμ΅λλ€.
data/
βββ chinese_receipt
βΒ Β βββ img
βΒ Β βΒ Β βββ test
βΒ Β βΒ Β βΒ Β βββ extractor.zh.in_house...jpg
βΒ Β βΒ Β βΒ Β βββ extractor.zh.in_house...jpg
βΒ Β βΒ Β βΒ Β βββ ...
βΒ Β βΒ Β βββ train
βΒ Β βΒ Β βββ extractor.zh.in_house...jpg
βΒ Β βΒ Β βββ extractor.zh.in_house...jpg
βΒ Β βΒ Β βββ ...
βΒ Β βββ ufo
βΒ Β βββ test.json
βΒ Β βββ train.json
βββ japanese_receipt
βΒ Β βββ img
βΒ Β βΒ Β βββ test
βΒ Β βΒ Β βΒ Β βββ extractor.ja.in_house...jpg
βΒ Β βΒ Β βΒ Β βββ extractor.ja.in_house...jpg
βΒ Β βΒ Β βΒ Β βββ ...
βΒ Β βΒ Β βββ train
βΒ Β βΒ Β βββ extractor.ja.in_house...jpg
βΒ Β βΒ Β βββ extractor.ja.in_house...jpg
βΒ Β βΒ Β βββ ...
βΒ Β βββ ufo
βΒ Β βββ test.json
βΒ Β βββ train.json
βββ thai_receipt
βΒ Β βββ img
βΒ Β βΒ Β βββ test
βΒ Β βΒ Β βΒ Β βββ extractor.th.in_house...jpg
βΒ Β βΒ Β βΒ Β βββ extractor.th.in_house...jpg
βΒ Β βΒ Β βΒ Β βββ extractor.th.in_house...jpg
βΒ Β βΒ Β βΒ Β βββ ...
βΒ Β βΒ Β βββ train
βΒ Β βΒ Β βββ extractor.th.in_house...jpg
βΒ Β βΒ Β βββ extractor.th.in_house...jpg
βΒ Β βΒ Β βββ ...
βΒ Β βββ ufo
βΒ Β βββ test.json
βΒ Β βββ train.json
βββ vietnamese_receipt
βββ img
βΒ Β βββ test
βΒ Β βΒ Β βββ extractor.vi.in_house...jpg
βΒ Β βΒ Β βββ extractor.vi.in_house...jpg
βΒ Β βΒ Β βββ ...
βΒ Β βββ train
βΒ Β βββ extractor.vi.in_house...jpg
βΒ Β βββ extractor.vi.in_house...jpg
βΒ Β βββ ...
βββ ufo
βββ test.json
βββ train.json
- λ°μ΄ν°μ μ λ€κ΅μ΄(μ€κ΅μ΄, μΌλ³Έμ΄, νκ΅μ΄, λ² νΈλ¨μ΄) μμμ¦ μ΄λ―Έμ§λ‘ νΈλν° μΉ΄λ©λΌ λ±μΌλ‘ μ°μ μμμ¦ μ¬μ§κ³Ό μ€μΊλ μμμ¦ μ¬μ§μΌλ‘ μ΄λ€μ§λ©°, train 400κ°(μΈμ΄λ³ 100κ°), test 120κ°(μΈμ΄λ³ 30κ°)λ‘ κ΅¬μ±λμ΄ μμ΅λλ€.
Train json νμΌμ UFO formatμ λ°λ₯΄λ©° paragraphs, words, characters, image width & height, image tag, annotation log, license tag λ±μΌλ‘ ꡬμ±λμ΄ μμ΅λλ€.
{
"images": {
"extractor.ja.in_house.appen_000911_page0001.jpg": {
"paragraphs": {},
"words": {
"0001": {
"transcription": "LAWSON",
"points": [
[
728.553329490908,
235.436074339687
],
[
735.9530472990916,
428.81846937705836
],
[
216.57843990309,
340.653026763541
],
[
220.926247854489,
246.740375013324
]
]
},
"chars": {},
"img_w": 960,
"img_h": 1280,
"num_patches": null,
"tags": [],
"relations": {},
"annotation_log": {
"worker": "worker",
"timestamp": "2024-06-07",
"tool_version": "",
"source": null
},
"license_tag": {
"usability": true,
"public": false,
"commercial": true,
"type": null,
"holder": "Upstage"
}
}
},
...
}
- pointλ κ° λΌλ²¨μ μμΉ μ’νμ΄λ©°, κΈμλ₯Ό μ½λ λ°©ν₯μ μΌμͺ½ μμμλΆν° μκ³ λ°©ν₯μΌλ‘ x,y μ’νλ‘ μ΄ 4κ°μ (x,y) μ’νλ‘ κ΅¬μ±λμ΄ μμ΅λλ€.
Test JSON νμΌμ Train JSON νμΌκ³Ό λμΌν ꡬ쑰λ₯Ό κ°μ§λ©°, λ¨ point μ λ³΄λ§ λΉ μ Έ μμ΅λλ€.
project
βββ EDA&Viz
βΒ Β βββ eda.ipynb
βΒ Β βββ result_viz.py
βΒ Β βββ result_viz.sh
βββ inference.py
βββ inference.sh
βββ preprocessing
βΒ Β βββ COCO2UFO.py
βΒ Β βββ CORD2UFO.ipynb
βΒ Β βββ SROIE2UFO.ipynb
βΒ Β βββ UFO2COCO.py
βββ README.md
βββ requirements.txt
βββ src
βΒ Β βββ dataset_CV2.py
βΒ Β βββ dataset.py
βΒ Β βββ deteval.py
βΒ Β βββ __init__.py
βΒ Β βββ TIoUeval.py
βββ train.py
βββ utils
βββ artifacts_download.py
βββ bbox_check.py
βββ create_train_val_tag.py
βββ create_val_data.py
λν κ·μ μ λ°λΌ EAST λͺ¨λΈμ΄ μ μλ μ½λλ μ μΈνμμ΅λλ€.
- eda.ipynb : μ΄λ―Έμ§ ν¬κΈ° λΆν¬, λ¨μ΄ κ°μ λΆν¬, Bounding box ν¬κΈ° λΆν¬, Aspect Ratio λΆν¬, μμ μ΄λ―Έμ§ λ±μ νμΈν μ μμ΅λλ€.
- result_viz.py: μ΅μ’
λͺ¨λΈ νκ° κ²°κ³Όλ₯Ό μκ°ννλ μ½λμ
λλ€. ν΄λΉ μ½λλ₯Ό μν΄ λ€μμ μ€νν΄μΌ ν©λλ€.
bash result_viz.sh
- COCO2UFO.py : COCO formatμ λ°μ΄ν°λ₯Ό UFO formatμ λ°μ΄ν°λ‘ λ³ννλ μ½λμ λλ€.
- CORD2UFO.ipynb : CORD formatμ λ°μ΄ν°λ₯Ό UFO formatμ λ°μ΄ν°λ‘ λ³ννλ μ½λμ λλ€.
- SROIE2UFO.ipynb : SROIE formatμ λ°μ΄ν°λ₯Ό UFO formatμ λ°μ΄ν°λ‘ λ³ννλ μ½λμ λλ€.
- UFO2COCO.py : UFO formatμ λ°μ΄ν°λ₯Ό COCO formatμ λ°μ΄ν°λ‘ λ³ννλ μ½λμ λλ€.
- dataset.py : λ°μ΄ν° λ‘λλ₯Ό μ μνλ μ½λμ λλ€. (PIL)
- dataset_CV2.py : λ°μ΄ν° λ‘λλ₯Ό μ μνλ μ½λμ λλ€. (CV2)
- deteval.py : DetEvalμ κ³μ°νλ μ½λμ λλ€.
- TIoUeval.py : TIoUλ₯Ό κ³μ°νλ μ½λμ λλ€.
- artifacts_download.py : Wandbμ μ μ₯λ μν°ν©νΈλ₯Ό λ€μ΄λ‘λνλ μ½λμ λλ€.
- bbox_check.py : Bounding box 체ν¬λ₯Ό μν μ½λμ λλ€.
- create_train_val_tag.py : Train & Validation json νμΌμ νκ·Έλ₯Ό μμ±νλ μ½λμ λλ€.
- create_val_data.py : Validation λ°μ΄ν°λ₯Ό μμ±νλ μ½λμ λλ€. (8 : 2 λΉμ¨)
μ΄ νλ‘μ νΈλ Ubuntu 20.04.6 LTS, CUDA Version: 12.2, Tesla v100 32GBμ νκ²½μμ νλ ¨ λ° ν μ€νΈλμμ΅λλ€.
λν, μ΄ νλ‘μ νΈμλ λ€μν λΌμ΄λΈλ¬λ¦¬κ° νμν©λλ€. λ€μ λ¨κ³λ₯Ό λ°λΌ νμν λͺ¨λ λΌμ΄λΈλ¬λ¦¬λ₯Ό μ€μΉν μ μμ΅λλ€.
git clone https://github.com/boostcampaitech7/level2-cv-datacentric-cv-23.git
cd level2-datacentric-cv-23
pip install -r requirements.txt
νλ‘μ νΈμ λν μμΈν λ΄μ©μ Wrap-Up Report μμ νμΈν μ μμ΅λλ€.