Spaces:
Runtime error
Runtime error
import streamlit as st | |
import numpy as np | |
import cv2 | |
from PIL import Image | |
import optic1 | |
from functions import image_show | |
def screen_scan_main(): | |
st.title("Optik Okuma") | |
image_file = st.file_uploader( | |
"Upload image for testing", type=['jpeg', 'png', 'jpg', 'webp']) | |
if image_file != None: | |
image = Image.open(image_file) | |
image = np.array(image.convert('RGB')) | |
if st.button("Process"): | |
#(ans_txt,pathImage, save_images= True) | |
grading, wrong_ans, student_idFix, resim_list =optic1.optic1(ans_txt="cevapanahtari.txt",pathImage=image,save_images=False) | |
image_show(resim_list) | |
grading = str(grading) | |
wrong_ans = str(wrong_ans) | |
student_idFix = str(student_idFix) | |
st.write("Notu:",grading) | |
st.write("Yanlis Yaptigi sorular:",wrong_ans) | |
st.write("Ogrenci Numarasi:",student_idFix) | |
#python -m streamlit run app.py | |
if __name__ == '__main__': | |
screen_scan_main() |