embed / app.py
om-app's picture
Update app.py
5e43fe5
raw
history blame
652 Bytes
from transformers import pipeline
from flask import Flask, request, jsonify
app = Flask(__name__)
# Create the pipeline for image upscaling
upscaler = pipeline("image-upscaling", model="deepset/electricity-converter-0036")
# Define the route for the home page
@app.route('/')
def home():
return 'Image Upscaling App'
# Define the route for the image upscaling
@app.route('/upscale', methods=['POST'])
def upscale():
# Get the uploaded image
file = request.files['file']
# Upscale the image
output = upscaler(file)
# Return the upscaled image
return jsonify({'image': output})
if __name__ == '__main__':
app.run()