Spaces:
Runtime error
Runtime error
Download app.py from prtm/AI-Image-Captioning-Using-Transfer-Learning: direct link, hf CLI and curl.
- Browser
- Download file 607 Bytes
-
https://huggingface.co/spaces/prtm/AI-Image-Captioning-Using-Transfer-Learning/resolve/main/app.py
- Command line
-
hf download hf://spaces/prtm/AI-Image-Captioning-Using-Transfer-Learning/app.py
-
curl -L -o app.py https://huggingface.co/spaces/prtm/AI-Image-Captioning-Using-Transfer-Learning/resolve/main/app.py
607 Bytes
| from flask import Flask, render_template, redirect, request | |
| import Caption_it1 | |
| app=Flask(__name__) | |
| def hello(): | |
| return render_template('index.html') | |
| def marks(): | |
| if request.method=='POST': | |
| f=request.files['userfile'] | |
| path='static/{}'.format(f.filename) | |
| f.save(path) | |
| caption=Caption_it1.caption_this_image(path) | |
| result_dic={ | |
| 'image':path, | |
| 'caption':caption | |
| } | |
| return render_template('index.html',your_result=result_dic) | |
| if __name__=='__main__': | |
| app.run(debug=True) |