jeongwoo1998 / OSS_TeamProject

2024_OSS_TeamProject
MIT License
1 stars 0 forks source link

๐ŸŒ OSS Team Project

2024ํ•™๋…„๋„ 1ํ•™๊ธฐ ์ „๋ถ๋Œ€ํ•™๊ต OSS ํŒ€ ํ”„๋กœ์ ํŠธ

๐Ÿ—ฃ ๋ชฉ์ฐจ

๐Ÿš€ ์˜์นผ๋กœ๋ฆฌ

๐Ÿ’ก ์‹คํ–‰ ๋ฐฉ๋ฒ•

๐Ÿ“„ ํ”„๋กœ์ ํŠธ ๋ฌธ์„œํ™”

๐Ÿš€ ์˜์นผ๋กœ๋ฆฌ

โœ… ํ”„๋กœ์ ํŠธ ๋ช…

๐Ÿง‘๐Ÿผโ€๐Ÿณ ์˜์นผ๋กœ๋ฆฌ = ์˜์–‘์†Œ + ์นผ๋กœ๋ฆฌ

โœ… ํŒ€ ๊ตฌ์„ฑ

์ด๋ฆ„ ๋‹ด๋‹น ์—ญํ• 
์ด์ •์šฐ Front-end ํŒ€์žฅ ๋ฌธ์„œ ์ž‘์—… UI ๋””์ž์ธ Front-end ์ด๊ด„
์ด๋ฏผํ˜ Front-end UI ๋””์ž์ธ
์žฅ์ •์šฐ Back-end ์Œ์‹ ์ธ์‹ ๋ชจ๋ธ(AI) API ๊ตฌ์ถ• ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ๊ตฌ์ถ•
์ฝ”๋“œ ์—ฐ๋™ (Front + Back) GIT ๋ฒ„์ „ ๊ด€๋ฆฌ Notion ๋ฌธ์„œ์ •๋ฆฌ
์กฐํ›ˆํฌ Back-end ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ๊ตฌ์ถ• ๋กœ๊ทธ์ธ ๊ธฐ๋Šฅ


โœ… ๊ธฐ์ˆ  ์Šคํƒ

โœ” Front-end

โœ” Back-end

โœ” API

โœ” Tool



โœ… ๊ฐœ์š”

๋‹ค์ด์–ดํŠธ๋‚˜ ๊ฑด๊ฐ• ๊ด€๋ฆฌ์™€ ๊ฐ™์€ ์ด์œ ๋กœ ์‹๋‹จ ์กฐ์ ˆ์ด ํ•„์š”ํ•œ ์‚ฌ๋žŒํ•œํ…Œ ๋„์›€์„ ์ค„ ์ˆ˜ ์žˆ๋Š” ์‹๋‹จ ๊ด€๋ฆฌ ์ง€์› ํ”„๋กœ๊ทธ๋žจ

โœ… ์ฃผ์š” ๊ธฐ๋Šฅ

1. ์†Œ์…œ ๋กœ๊ทธ์ธ ์—ฐ๋™ ์ง€์› (Google / Kakao)

2. ์‚ฌ์šฉ์ž๊ฐ€ ์—…๋กœ๋“œํ•œ ์Œ์‹ ์‚ฌ์ง„์„ ๋ถ„์„ํ•˜์—ฌ ์‚ฌ์ง„์— ์žˆ๋Š” ์Œ์‹์˜ ์˜์–‘ ์„ฑ๋ถ„, ์นผ๋กœ๋ฆฌ ๋“ฑ์˜ ์ •๋ณด ์ œ๊ณต

3. ๋ถ„์„ํ•œ ์Œ์‹ ์ •๋ณด๋ฅผ ๋ฐ”ํƒ•์œผ๋กœ ์‚ฌ์šฉ์ž ๋ชฉํ‘œ ์„ญ์ทจ๋Ÿ‰ ๋‹ฌ์„ฑ ์—ฌ๋ถ€ ํ™•์ธ

4. ์‚ฌ์šฉ์ž์˜ ์‹๋‹จ์—์„œ ๋ถ€์กฑํ•œ ์˜์–‘ ์„ฑ๋ถ„์„ ๊ธฐ๋ฐ˜์œผ๋กœ ์Œ์‹ ๋˜๋Š” ๊ทผ์ฒ˜ ์‹๋‹น ์ถ”์ฒœ

โœ… ์„œ๋น„์Šค ๊ตฌ์„ฑ๋„



โœ… ๊ธฐ๋Œ€ ํšจ๊ณผ

โ€œ์‹์Šต๊ด€์„ ๊ธฐ๋กํ•˜๋Š” ์•ฑ ์‚ฌ์šฉ์ž๋ฅผ ๋Œ€์ƒ์œผ๋กœ ํ•œ ์—ฐ๊ตฌ ๊ฒฐ๊ณผย ๋Œ€์ƒ์ž์˜ ์•ฝ 77.9%์—์„œ ์„ฑ๊ณต์ ์ธ ์ฒด์ค‘ ๊ฐ๋Ÿ‰ ํšจ๊ณผ๋ฅผ ํ™•์ธํ–ˆ์œผ๋ฉฐ ์ด ์ค‘ 23%๋Š” ๋ณธ์ธ ์ฒด์ค‘์˜ 10% ์ด์ƒ ๊ฐ๋Ÿ‰ ์— ์„ฑ๊ณตํ•œ ๊ฒƒ์œผ๋กœ ๋‚˜ํƒ€๋‚ฌ๋‹ค.โ€

[์ถœ์ฒ˜] ์˜ํ•™์‹ ๋ฌธ

๐Ÿ’ก ์‹คํ–‰ ๋ฐฉ๋ฒ•

๐Ÿ’ป ํ•„์š”ํ•œ ํˆด

๐Ÿ Python 3.11 ๋ฒ„์ „ ์ด์ƒ ์‚ฌ์šฉ์„ ๊ถŒ์žฅํ•ฉ๋‹ˆ๋‹ค.


โ— ๐Ÿ“ Front-end, ๐Ÿ“ Back-end ํด๋”๋ฅผ VS Code ๋ฅผ ํ†ตํ•ด ๋”ฐ๋กœ ์‹คํ–‰์‹œํ‚ต๋‹ˆ๋‹ค.

๐Ÿ“ ํด๋” ๊ตฌ์กฐ

โ”œโ”€โ”€ ๐Ÿ“ Front-end
โ”‚   โ”‚
โ”‚   โ””โ”€โ”€ ...
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ Back-end
โ”‚   โ”‚
โ”‚   โ””โ”€โ”€ ...
โ”‚   
โ”œโ”€โ”€ ๐Ÿ“ Image
โ”‚   
โ””โ”€โ”€ ๐Ÿ“ ...

๐Ÿง‘๐Ÿผโ€๐Ÿณ Front-end


๐Ÿš€ ์‹คํ–‰

  1. node.js ๋ฅผ ์„ค์น˜ํ•ฉ๋‹ˆ๋‹ค.

  2. VS Code ๋ฅผ ํ†ตํ•ด Front-end ํด๋”๋ฅผ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค.

  3. npx expo start ๋ฅผ ํ„ฐ๋ฏธ๋„ ์ฐฝ์— ์ž…๋ ฅํ•˜์—ฌ Expo ๋ฅผ ์‹คํ–‰์‹œํ‚ต๋‹ˆ๋‹ค.

๐Ÿง‘๐Ÿผโ€๐Ÿณ Back-end


VS Code ๋ฅผ ํ†ตํ•ด Back-end ํด๋”๋ฅผ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค.

๐Ÿ”— Google Drive์—์„œ ์Œ์‹ ์ธ์‹ ๋ฐ ์–‘ ์ถ”์ • ๋ชจ๋ธ ๋‹ค์šด๋กœ๋“œ

  1. Google Drive ๋‹ค์šด๋กœ๋“œ ๋งํฌ๋กœ ์ด๋™ํ•ฉ๋‹ˆ๋‹ค.
  2. ๋‹ค์Œ ํŒŒ์ผ๋“ค์„ ๋‹ค์šด๋กœ๋“œํ•ฉ๋‹ˆ๋‹ค.
    • yolov3.zip
    • quantity_est.zip

๐Ÿšฆ ํŒŒ์ผ ์••์ถ• ํ•ด์ œ

  1. yolov3.zip ํŒŒ์ผ์„ ์••์ถ• ํ•ด์ œํ•ฉ๋‹ˆ๋‹ค.

  2. quantity_est.zip ํŒŒ์ผ์„ ์••์ถ• ํ•ด์ œํ•ฉ๋‹ˆ๋‹ค.

๐Ÿช„ ํŒŒ์ผ ์ •๋ฆฌ

  1. ์••์ถ• ํ•ด์ œํ•œ ํŒŒ์ผ๋“ค์„ Back-end/FoodRecognition ํด๋”์— ์œ„์น˜์‹œํ‚ต๋‹ˆ๋‹ค.

๐Ÿ“ฆ ํ•„์š”ํ•œ ํŒจํ‚ค์ง€ ์„ค์น˜

  1. Back-end/requirements.txt ํŒŒ์ผ์„ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.

  2. pip install -r requirements.txt

๐Ÿš€ ์‹คํ–‰

โ— ์‹คํ–‰ ์ „ ๐Ÿ”‘ ํ•„์ˆ˜ ์„ค์ •์„ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.

  1. app.py ํŒŒ์ผ์„ ์‹คํ–‰์‹œํ‚ต๋‹ˆ๋‹ค.

โš  ์˜ค๋ฅ˜ ๋ฐœ์ƒ ์‹œ

quantity_est yolov3 ์ธ์‹์ด ์•ˆ๋  ๊ฒฝ์šฐ (์›์ธ โžก ํŒŒ์ผ ์••์ถ• ํ•ด์ œ ๊ณผ์ •์—์„œ ํŒŒ์ผ ์ค‘๋ณต)

from quantity_est.quantity_est.food_quantity_model import quantity
from yolov3.yolov3.food_recognition_model import detect, get_nutrients

๐ŸŒˆ How to use API

Swagger : localhost:5000/swagger

๐Ÿง‘๐Ÿผโ€๐Ÿณ Android Emulator


โš™ ์„ค์ •

  1. Android Studio ๋ฅผ ์„ค์น˜ํ•ฉ๋‹ˆ๋‹ค.

  2. Android Studio ํ”„๋กœ์ ํŠธ๋ฅผ No Activity ๋กœ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.

  3. Device Manager ์ฐฝ์˜ + ๋ฒ„ํŠผ์„ ๋ˆŒ๋Ÿฌ Create Virtual Device ๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

  4. Pixel 8 ์„ ์„ ํƒํ•˜์—ฌ Android Emulator ์ƒ์„ฑ์„ ์™„๋ฃŒํ•ฉ๋‹ˆ๋‹ค.

  5. Android Emulator ๋ฅผ ์‹คํ–‰์‹œํ‚ต๋‹ˆ๋‹ค.

  6. Android Emulator ์˜ Location ์„ ํ˜„์žฌ ์œ„์น˜๋กœ ๋ฐ”๊ฟ”์ค๋‹ˆ๋‹ค.
    • Android Emulator ์‹คํ–‰ ํ›„ ... ๋ฒ„ํŠผ์„ ๋ˆ„๋ฆ…๋‹ˆ๋‹ค.
    • Location ์„ ๋ˆŒ๋Ÿฌ ํ˜„์žฌ ์œ„์น˜๋กœ ์„ค์ • ํ›„ Set Location ์„ ๋ˆ„๋ฆ…๋‹ˆ๋‹ค.

  7. ํ”„๋กœ์ ํŠธ Image ํด๋” ์•ˆ์˜ ์‚ฌ์ง„๋“ค์„ Android Emulator ์— ๋„ฃ์–ด์ค๋‹ˆ๋‹ค.

    • Drag & Drop
    • Image ํด๋” ์•ˆ์˜ ์‚ฌ์ง„๋“ค์„ Android Emulator ํ™”๋ฉด์— ์ง์ ‘ ๋Œ์–ด๋‹ค ๋„ฃ์Šต๋‹ˆ๋‹ค.

๐Ÿš€ ์‹คํ–‰

  1. Expo ๋ฅผ ์‹คํ–‰์‹œํ‚จ Front-end ํ„ฐ๋ฏธ๋„๋กœ ๋Œ์•„์˜ต๋‹ˆ๋‹ค.

  2. Front-end ํ„ฐ๋ฏธ๋„์—์„œ a ํ‚ค๋ฅผ ๋ˆŒ๋Ÿฌ Android Emulator ๋ฅผ ํ†ตํ•ด ์–ดํ”Œ์„ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค.

๐Ÿ”‘ ํ•„์ˆ˜ ์„ค์ •


  1. ๐Ÿ“„ ํ”„๋กœ์ ํŠธ ๋ฌธ์„œํ™” Notion ์— ์ •๋ฆฌ๋˜์–ด ์žˆ๋Š” API KEY ์ฐธ๊ณ ํ•˜์—ฌ ํŒŒ์ผ์— ๋„ฃ์Šต๋‹ˆ๋‹ค.

โš  ์ฃผ์˜ ์‚ฌํ•ญ


Google Login

  1. ngrok ์„ค์น˜ ํ›„ ํ„ฐ๋ฏธ๋„์—์„œ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค.

  2. ngrok http 5000 ์ž…๋ ฅ ํ›„ ๋‚˜์˜จ ์ฃผ์†Œ๋ฅผ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.

  3. Google Cloud Console ์— ์ ‘์†ํ•ฉ๋‹ˆ๋‹ค.

  4. Google Client ID Google Client Secret Google Redirect URI ๋ฅผ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.

  5. Back-end/Login/login.py Front-end/screens/GoogleLogin.js ์˜ ์ฝ”๋“œ๋ฅผ ์•Œ๋งž๊ฒŒ ์ˆ˜์ •ํ•ฉ๋‹ˆ๋‹ค.

๐Ÿ“„ ํ”„๋กœ์ ํŠธ ๋ฌธ์„œํ™”

  1. GITHUB

  2. NOTION

  3. SWAGGER

    • Back-end/app.py โžก localhost:5000/swagger