jeremyjordan / flower-classifier

A simple image classifier for flowers.

Home Page:https://share.streamlit.io/jeremyjordan/flower-classifier/app.py

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Improve "other {breed} examples" photos with memorization

jeremyjordan opened this issue · comments

What's your idea?
Let's improve how we show example photos of the model's predicted breed.

Currently, we have a component in the Streamlit UI which shows the user example three images of the predicted breed. We obtain these images through a query using the Google Images Search API. However, because our API only allows 100 free requests per day, we don't automatically show these images (the user must click an additional button to view them).

Describe the solution you'd like
Because we have a fixed set of possible flower breeds to query, we should query the service once and memorize the results. We can store the results in a JSON file that gets loaded alongside the Streamlit app. Each time our model makes a prediction, we can simply perform a dictionary lookup to get the image URLs of example photos.

{
  "breed": [url, url, url],
  ...
}

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.