Skip to content

connieliu0/pet-to-poetry

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 

Repository files navigation

Pet to Poetry - Fall 2020 Research Project

About

Upload a picture of a pet, and the YOLO algorithm will then recognize the pet in it. Then it will query the pet in the PoetryDB and send back a poem that mentions that pet. Depending on the brightness of the photo, you may get differing results! Let's see what poems are related to your pet! This project was created by Bo Hu and Connie Liu. Although this project is not currently hosted online, you can view a video demo here (insert youtube link).



References: Yolo v3 in Tensorflow by Kaggle notebook After cloning this repo, follow the following steps to compile and start the project.

Server compilation

The server is written in Python v3. To compile the server, go to /server folder and follow the instructions below.

Environment and Packages Setup

This project needs the virtual environment.

For mac users, that is to run the following commands:

python3 -m venv venv
. venv/bin/activate

and for Windows users:

py -3 -m venv venv
venv\Scripts\activate

After activating the virtual environment, run the following commands to install packages

pip install -r requirements.txt

Downloading official pretrained weights

Let's download official weights pretrained on COCO dataset.

wget -P weights https://pjreddie.com/media/files/yolov3.weights

Save the weights in Tensorflow format

Save the weights using load_weights.py script.

python load_weights.py

Running the project

After setting up the backend, we can start to run the project by going into /frontend_2 folder and enter command yarn dev.

The commands above assume that users are running this porject on a windows OS. If you are using a MacOS, go into /frontend_2/package.json and change server into

"server": "cd .. && cd server && . venv/bin/activate && flask run --no-debugger",

After the project is launched, follow the instructions on the website. Click upload to upload an image of your choice / change the image uploaded. Once you are all set, click Generate Poem to have a poetry for your pet :)

About

Pet to Poetry is a project made under the Designing AI lab at Cornell University in the Fall of 2020.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published