/final-project-level3-cv-02

final-project-level3-cv-01 created by GitHub Classroom

Primary LanguagePython

๐Ÿ›ด PM ( Personal Mobility ) ์œ„๋ฒ•ํ–‰์œ„ ๊ฐ์ง€ ์‹œ์Šคํ…œ

โ“ ๋“ฑ์žฅ ๋ฐฐ๊ฒฝ

์ตœ๊ทผ 3๋…„๊ฐ„ ๋„์‹œ์˜ ๊ฑฐ๋ฆฌ์— ์ƒ๊ธด ๊ฐ€์žฅ ํฐ ๋ณ€ํ™”๋Š” ๊ณต์œ  ํ‚ฅ๋ณด๋“œ๋ฅผ ํ•„๋‘๋กœ ํ•œ ๋‹ค์–‘ํ•œ ์ด๋™์ˆ˜๋‹จ์˜ ๋“ฑ์žฅ์ž…๋‹ˆ๋‹ค.
์‹ค์ œ๋กœ ๊ณต์œ  ํ‚ฅ๋ณด๋“œ ์„œ๋น„์Šค๊ฐ€ ๋„์ž…๋œ ๋’ค, ์„œ๋น„์Šค ์ด์šฉ ๊ฑด์ˆ˜๊ฐ€ 2020๋…„ ์ƒ๋ฐ˜๊ธฐ ๋Œ€๋น„ ํ•˜๋ฐ˜๊ธฐ์— 60%๊ฐ€ ์ฆ๊ฐ€ ํ•  ์ •๋„๋กœ PM ( Personal Molbility ) ์‹œ์žฅ์€ ๊ธ‰๊ฒฉ๋„๋กœ ํ™•์‚ฐํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ํ•˜์ง€๋งŒ ์ด์— ๋”ฐ๋ฅธ ์—ฌ๋Ÿฌ ๋ฌธ์ œ๋“ค๋„ ๊ฐ™์ด ๋ฐœ์ƒํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ์ด์šฉ๊ฐ์ด ์ฆ๊ฐ€ํ•œ ๋งŒํผ ๊ทธ์— ๋”ฐ๋ฅธ ์‚ฌ๊ณ ๋“ค๋„ ๋งŽ์ด ๋ฐœ์ƒํ•˜๊ณ  ์žˆ์œผ๋ฉฐ, "ํ‚ฅ๋ผ๋‹ˆ( ํ‚ฅ๋ณด๋“œ + ๊ณ ๋ผ๋‹ˆ )" ๋ผ๋Š” ์‹ ์กฐ์–ด ๊นŒ์ง€ ๋“ฑ์žฅํ•  ์ •๋„๋กœ ์šด์ „์ž ํ˜น์€ ๋ณดํ–‰์ž์—๊ฒŒ ์œ„ํ˜‘์ด ๋˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.
๊ทธ๋ž˜์„œ ์ •๋ถ€๋Š” ์ด์™€ ๊ด€๋ จ๋œ ๋ฒ•๊ณผ ์ œ๋„๋“ค์„ ๋งŒ๋“ค๊ณ  ์‹œํ–‰ํ•˜๊ณ  ์žˆ์ง€๋งŒ ์ž˜ ์ง€์ผœ์ง€์ง€ ์•Š์•„ ์•„์ง๋„ ๋งŽ์€ ์‚ฌ๊ณ ๋“ค์ด ์ž‡๋”ฐ๋ฅด๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ๊ทธ๋ž˜์„œ ์ €ํฌ ํŒ€์€ ํ‚ฅ๋ณด๋“œ ์œ„๋ฒ•ํ–‰์œ„ ( ํ—ฌ๋ฉง ๋ฏธ์ฐฉ์šฉ, ๋™์Šน ) ํƒ์ง€๋ฅผ ์ž๋™ํ™” ํ•˜์—ฌ ์‚ฌ์šฉ์ž๋“ค์˜ ์•ˆ์ „ํ•œ ์ „๋™ ํ‚ฅ๋ณด๋“œ ์‚ฌ์šฉ์„ ๋„๋ชจํ•˜๋ ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค.


๐Ÿ™„๋ฌธ์ œ ์ •์˜

์ด๋ฏธ์ง€, ๋™์˜์ƒ, ์‹ค์‹œ๊ฐ„ ์˜์ƒ์—์„œ Object Detection์„ ์ด์šฉํ•˜์—ฌ ์‚ฌ์šฉ์ž์˜ ํ‚ฅ๋ณด๋“œ ์‚ฌ์šฉ ์œ„๋ฒ•ํ–‰์œ„ ( ํ—ฌ๋ฉง ๋ฏธ์ฐฉ์šฉ, ๋™์Šน )๋ฅผ ํƒ์ง€ํ•˜๊ณ  ์ด์šฉ์ž์˜ ์•ˆ์ „ํ•œ ์ฃผํ–‰์„ ์œ ๋„ํ•œ๋‹ค.


๐Ÿ‘ฉโ€๐Ÿซ๊ฐœ๋ฐœ ํ™˜๊ฒฝ

  • GPUํ™˜๊ฒฝ : V100 ์„œ๋ฒ„, Google Cloud Platform(GCP) ์„œ๋ฒ„
  • ํŒ€ ํ˜‘๋ ฅ Tools : Notion, Weights&Biases, Github, Google Drive
  • ๊ฐœ๋ฐœ Tools : VScode, Jupyter Lab
  • ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ๋ฐ ํ”„๋ ˆ์ž„์›Œํฌ : PyTorch, Streamlit, FastAPI
  • Annotation Tools : Supervisely

๐Ÿ‘จโ€๐Ÿซํ‰๊ฐ€ Metric


๐Ÿ›ด๋ฐ์ดํ„ฐ์…‹

๋ผ๋ฒจ๋ง

๋ฐ์ดํ„ฐ ๋ฒ„์ „ ๊ด€๋ฆฌ

Version ๋ฐ์ดํ„ฐ ์ˆ˜ Train ๋ฐ์ดํ„ฐ ์ˆ˜ Val ๋ฐ์ดํ„ฐ ์ˆ˜ Test ๋ฐ์ดํ„ฐ ์ˆ˜ ์„ธ๋ถ€์‚ฌํ•ญ
1.0 1128 790 225 113 ์ดˆ๊ธฐ ๋ฐ์ดํ„ฐ์…‹
2.0 1321 960 240 121 Class ๋ถˆ๊ท ํ˜• ํ•ด์†Œ๋ฅผ ์œ„ํ•œ ์ด๋ฏธ์ง€ ์ถ”๊ฐ€
2.1 1364 1003 240 121 Edge case ํ•ด๊ฒฐ์„ ์œ„ํ•ด ํ•ฉ์„ฑ ์ด๋ฏธ์ง€ ์ถ”๊ฐ€
2.2 1364 995 245 124 ๋ฐ์ดํ„ฐ์…‹(Train, Val, Test) ์žฌ์กฐ์ •
3.0 1447 1078 245 124 Box ์—†๋Š” ๋ฐฐ๊ฒฝ ์ด๋ฏธ์ง€ ์ถ”๊ฐ€

Input

  • PM์œผ๋กœ ์ฃผํ–‰์ค‘์ธ ์‚ฌ๋žŒ์ด ๋‹ด๊ธด ์ด๋ฏธ์ง€ or ์˜์ƒ ๋ฐ์ดํ„ฐ
  • ํฌ๋กค๋ง, ์ง์ ‘ ์ดฌ์˜์œผ๋กœ ๋ชจ์€ ๋ฐ์ดํ„ฐ
  • ์ด๋ฏธ์ง€์˜ ๋‹ค์–‘์„ฑ, ์ €์ž‘๊ถŒ, ์ดˆ์ƒ๊ถŒ ๊ณ ๋ ค
  • Supervisely ํˆด์„ ์ด์šฉํ•˜์—ฌ ์ง์ ‘ Annotation
  • ๋ผ๋ฒจ : 0๋ฒˆ(ํ—ฌ๋ฉงO, ํ˜ผ์žO), 1๋ฒˆ(ํ—ฌ๋ฉงX, ํ˜ผ์žO), 2๋ฒˆ(ํ—ฌ๋ฉงO,ํ˜ผ์žX), 3๋ฒˆ(ํ—ฌ๋ฉงX,ํ˜ผ์žX)
  • ํƒœ๊ทธ : Orientation, Blur, Out of Focus, Low quality
  • ํ˜•์‹ : JSON, YOLO

Output

  • ์ด์šฉ์ž์˜ ํ—ฌ๋ฉง ์ฐฉ์šฉ์—ฌ๋ถ€์™€ ๋™์Šน์—ฌ๋ถ€ ๋ถ„๋ฅ˜
  • PM๊ณผ ์ด์šฉ์ž๋ฅผ ํ•จ๊ป˜ detectionํ•˜๊ณ  ๋ถ„๋ฅ˜
  • ํœด๋Œ€ํฐ ์‚ฌ์šฉ์—ฌ๋ถ€, ์—ฐ๋ น๊นŒ์ง€ ํ™•์žฅ ๊ฐ€๋Šฅ

๐Ÿ‘จโ€๐Ÿ’ปModel

YOLOR YOLOR2

  • 1 Stage Detection ๋ชจ๋ธ
  • ๋น ๋ฅธ ์†๋„, ๋ณด์žฅ๋œ ์„ฑ๋Šฅ
  • ๋™์˜์ƒ inference
  • ํ•ต์‹ฌ ํ‚ค์›Œ๋“œ : Implicit Knowledge

YOLOR ๋ชจ๋ธ ๊ตฌ์กฐ

model1

Backbone : CSPDarkNet53

  • DarkNet53์— CSP ์ ์šฉ
  • Feature๋ฅผ ๋‘˜๋กœ ๋‚˜๋ˆ„์–ด ํ•˜๋‚˜์˜ Part๋งŒ ์—ฐ์‚ฐํ•˜๊ณ  Concat
  • Feature map์ด ๋ˆ„์ ๋˜์–ด ๊ณ„์‚ฐ๋˜๋Š” DenseNet์˜ ๋ฌธ์ œ์  ๊ทน๋ณต

model2

Head : YOLOv4-large Head

  • Spatial Pyramid Pooling ์ ์šฉ
  • Multi Level Feature ์‚ฌ์šฉ
    • Semanticํ•œ ์ •๋ณด์™€ Fine-grained ์ •๋ณด๋ฅผ ํฌํ•จ
  • Implicit Knowledge ์ ์šฉ
    • Addition, Multiplication ๋ฐฉ์‹
    • Good representation์„ ํ†ตํ•ด ๋ฐ์ดํ„ฐ๋ฅผ ์ž˜ ๊ตฌ๋ถ„ํ•  ์ˆ˜ ์žˆ๋Š” Hyper plain์„ ์ฐพ์•„์„œ ์„ฑ๋Šฅ ํ–ฅ์ƒ

์ตœ์ข… ๋ชจ๋ธ

model3


๐Ÿ™Œ๊ฒฐ๊ณผ

Precision Recall mAP50 mAP0.5~0.95
All 0.907 0.803 0.881 0.642
Alone Helmet 0.865 0.804 0.864 0.597
Alone no Helmet 0.797 0.87 0.898 0.674
Sharing Helmet 1 0.667 0.833 0.567
Sharing no Helmet 0.964 0.871 0.927 0.729

๐Ÿ™†โ€โ™‚๏ธํ”„๋กœํ† ํƒ€์ž…

Image

streamlit-streamlit-app-2021-12-23-12-12-45