Click here to try
Ever seen a cute doggo on the street? And wonder what kind of dog is that? SAY NO MORE, I got you! Just take a picture of that cutie, and let Dog Breed Classifier help you. Upload the image, sit back and voilà, the detailed information of your cute dog is right in front of you!!
The result might not be accurate in some situations due to bias when filtering. In addition, labeling might identify another object if the background of the image is too overwhelming, or simply because there are too many subjects in the picture. This project is mainly to demonstrate the potential of using Google Vision AI for image recognition. As a result, this project should not be used in development.
app.pyis the main Python file. It is used for processing, labeling, and filtering the input image as well as managing the Flask server.templatesdirectory contains 2 files:index.htmlandresult.html, which are served by Flask.tempwas set to be the static directory for this project. It also serves as a temporary folder to store images for analyzing.temp/static_servingis the directory contains the common resources between web pages (functions.js,style.js, anddefaultPreview.jpg).blacklist.jsoncontains a list of keywords that should be exempted from the return data. For example, you don't want the app to recognize a special breed of Corgi ("Cardigan Welsh Corgi"), then add the name here.GCloud_credentials.json: a unique private API credential from Google Vision, that can be obtained after following Google Vision Docs.TheDogAPI.json: contains a unique private API key, can be obtained free via The Dog API.
- Build the image using
Dockerfilein the project. Then run and access local host viahttp://0.0.0.0:PORT/, the default value ofPORTis 5000 inDockerfile.
pip install --no-cache-dir -r requirements.txtto install dependencies (Alternatively, you can install inpipenv).- Set up
GCloud_credentials.jsonin the project. Consult Google Cloud Vision setup page for detailed steps. - Obtain an API key from The Dog API and add the key to file
TheDogAPI.jsonin this format (substituteYOUR_API_KEYwith the obtained API key):
{
"x-api-key": "YOUR_API_KEY"
}
-
Set up os environment manually in
app.pyfor:BLACKLISTGOOGLE_APPLICATION_CREDENTIALSDOG_API_KEYPORTaccording to the relative paths in your machine.
-
python app.pyorpython3 app.pyto start the Flask server. -
Go to
http://0.0.0.0:PORT/(PORT is the value you set) to see the result.
- For a full list of dependencies used in the project, consult
requirements.txt.


