/CS470-Team-25

Primary LanguageJupyter Notebook

CS470-Team-25

Requirements

To install Requirements, use

$ pip3 install -r requirements.txt

The model is written and tested on cuda enviroment

Also, you have to download ckpt.pt from below link and place into ./cat_id/flask_deep/ https://drive.google.com/file/d/1pcQRjzuhWySDOAnumXhN16y5s9jBK1Ni/view?usp=sharing

Experiment

To launch demos, move to cat_id directory and execute

$ python3 server.py

Then you can access to the demo by move to the address in your browser,

127.0.0.1:5000

This is the result page you will see after uploading a cat image. result.html

File Structure

.
|-- data_collect
|   |-- crawling.py
|   |-- rename.py
|   |-- used.txt
|   |-- url.txt
|-- cat_id
|   |-- server.py
|   |-- flask_deep
|       |-- static
|       |   |-- css
|       |-- templates
|       |   |-- result.html
|       |   |-- upload.html
|       |-- init.py
|       |-- Classifier.py
|-- Classifier.py
|-- resave.py
|-- test_model.py
|-- 대표이미지
|-- cropped_cat
|-- cropped_cat_2

'crawling.py'

Python file for crawling cat photos from Instagram accounts in url.txt

'url.txt'

crawling.py gets photos from accounts in this texts

'used.txt'

contains all accounts used for data collectin

Classifier.py

The main Function that preprocess and train model

resave.py

Utility script to reduce the size of the checkpoint file

test_model.py

Plot train/valid accuracy/loss and show some examples

./cat_id

Directory that include service frontend/backend

  • ./server.py Run the server

  • ./flask_deep/__init__.py Script that execute server

  • ./flask_deep/templates/upload.html html page for uploading page of 'cat_id'

  • ./flask_deep/templates/result.html html page showing uploaded image and predicted images

./data_collect

Directory that include crawler & dataset

  • rename.py Utility function to reorganize file structure

./cropped_cat

Trials to crop the cat face using the pretrained model of pycatfd

./cropped_cat2

Trials to crop the cat face using the pretrained model of Haar Cascade Model in OpenCV

'./cropped_cat3'

Trials to crop the cat face by handwork using labelImg. This folder is in the branch: crop-images.