File size: 537 Bytes
ff522d1
 
 
 
 
 
f2cdac9
3519dbd
f2cdac9
 
ff522d1
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import numpy as np
from make_predictions import make_prediction
import gradio as gr

def predict(file):
    # print(file.name)
    # print(file)
    with open(file.name, 'r', encoding="base64") as f:
        print(f.read())
    print("=====================================")
    ans = make_prediction(file.name)
    return {ans[0] :ans[1]}

iface = gr.Interface(predict, "file", "label", title="ECG Classification", description="Upload an ECG file to classify it as Normal or Abnormal", examples=[["data/faizan_r8.txt"]])
iface.launch()