import os os.system("pip -qq install h5py") os.system("pip -qq install torch") os.system("pip -qq install torchvision") os.system("pip -qq install pandas") os.system("pip -qq install scikit-image") from dataset import FrameDataset import numpy as np import gradio as gr def generate_frames(ffile,dfile): dataset = FrameDataset(ffile=ffile,dfile=dfile) patches = dataset.get_peaks_skimage() normalized_patches = dataset.normalize_patches(patches) np.save("normalized_patches.npy",normalized_patches) return normalized_patches interface=gr.Interface(fn=generate_frames, inputs=[gr.File(label="frame file",type="binary"),gr.File(label="dark file",type="binary")], outputs=gr.outputs.File("peaks.npy")) interface.launch()