fal2022-videoanalysis-v2 / CustomFile.py
Frank Pacini
copy repo
6155c0e
raw
history blame
536 Bytes
import gradio as gr
# from typing import Dict
# import base64
# def encode_file_to_base64(f):
# with open(f, "rb") as file:
# encoded_string = base64.b64encode(file.read())
# base64_str = str(encoded_string, "utf-8")
# return base64_str
class CustomFile(gr.File):
# def postprocess(self, y: str) -> Dict:
# res = super().postprocess(y)
# if res is not None:
# res['data'] = encode_file_to_base64(res['name'])
# return res
def dummy(self):
return