Skip to content

woctezuma/heroku-flask-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Heroku Flask API

Deploy an API built with Flask on Heroku.

Data

Data consists of images from the Steam store (~30k games) downloaded on January 9, 2021.

Usage

To run locally:

python run.py

To deploy:

heroku login
heroku create
git push heroku main

Web App

The web app can be accessed at this URL:

https://damp-brushlands-51855.herokuapp.com/

To ask for results about Cyberpunk 2077, you have to append the appID (1091500) to the /render/ endpoint:

https://damp-brushlands-51855.herokuapp.com/render/1091500/

Or you can try your luck with a random game. Caveat: some Steam games can be offensive!

https://damp-brushlands-51855.herokuapp.com/render/

Number of matches

To tweak the number of matches, for instance to 5 instead of the default (11): render/1091500/5

Direct links to the Steam store

To have direct links to the Steam store: store/1091500/

Mirror and flip

CLIP seems be attentive to texts present on images. To try to mitigate this effect, the query image can be:

  • mirrored (i.e. horizontally),
  • flipped (i.e. vertically).

To mirror the query image: render_x/ or render/?mirror=1

To flip the query image: render_y/ or render/?flip=1

To mirror and flip the query image: render_xy/ or render/?mirror=1&flip=1

References

  • steam-CLIP: retrieve games with similar banners, using OpenAI's CLIP (resolution 224),
  • heroku-flask-api: serve the matching results through an API built with Flask on Heroku,
  • heroku-clip: deploy an app built with Streamlit on Heroku.