File size: 804 Bytes
93a2cb0
 
 
 
 
9b97f22
93a2cb0
3d9ff5c
9258b52
 
a0dd22b
 
3d9ff5c
9f5ee14
 
 
 
 
240b000
1027793
e8cd814
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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",preprocess=False,type="binary"),gr.File(label="dark file",preprocess=False,type="binary")],
                       outputs=gr.outputs.File("peaks.npy"))
interface.launch()