Last active
July 2, 2021 10:54
-
-
Save neelriyer/bbf1ddea54ed9acc45e6aec398e97e54 to your computer and use it in GitHub Desktop.
detectron2 web app boilerplate flask code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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