from flask import Flask, request, jsonify | |
from summarize import Vid2Sum | |
app = Flask(__name__) | |
def predict(): | |
# Check if video file is included in the request | |
if 'video' not in request.files: | |
return jsonify({'error': 'No video file found'}), 400 | |
video_file = request.files['video'] | |
# Perform video-to-text conversion using your existing code | |
text_output = Vid2Sum(video_file) | |
return jsonify({'text': text_output}) | |
if __name__ == '__main__': | |
app.run() | |