Skip to content

Instantly share code, notes, and snippets.

@neelriyer
Last active July 2, 2021 10:54
Show Gist options
  • Save neelriyer/bbf1ddea54ed9acc45e6aec398e97e54 to your computer and use it in GitHub Desktop.
Save neelriyer/bbf1ddea54ed9acc45e6aec398e97e54 to your computer and use it in GitHub Desktop.
detectron2 web app boilerplate flask code
import io
from flask import Flask, render_template, request, send_from_directory, send_file
from PIL import Image
import requests
import os
import urllib.request
app = Flask(__name__)
@app.route("/")
def index():
# render the index.html template
return render_template('index.html')
if __name__ == "__main__":
# get port. Default to 8080
port = int(os.environ.get('PORT', 8080))
# run app
app.run(host='0.0.0.0', port=port)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment