Spaces:
Runtime error
Runtime error
Commit
·
e6dc665
1
Parent(s):
2214d00
v2
Browse files- analysis_func.py +8 -0
- app.py +9 -7
- cevapanahtari/cevapanahtari_ders1.txt +20 -0
- cevapanahtari/cevapanahtari_ders2.txt +20 -0
- cevapanahtari/cevapanahtari_ders3.txt +20 -0
- data +1 -1
- data_func.py +2 -2
- denemeler/100luk_numarali.jpg +0 -0
- denemeler/bossikli.jpg +0 -0
- functions.py +16 -3
- optic1.py +37 -18
- requirements.txt +1 -2
- screen/__pycache__/screen_add_note.cpython-310.pyc +0 -0
- screen/__pycache__/screen_note.cpython-310.pyc +0 -0
- screen/__pycache__/screen_scan.cpython-310.pyc +0 -0
- screen/screen_about.py +5 -0
- screen_add_note.py → screen/screen_add_note.py +1 -1
- screen/screen_analysis.py +17 -0
- screen_note.py → screen/screen_note.py +3 -7
- screen/screen_scan.py +55 -0
- screen_scan.py +0 -33
- toDo.txt +11 -0
analysis_func.py
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import pandas as pd
|
2 |
+
import numpy as np
|
3 |
+
|
4 |
+
def read_csv(path):
|
5 |
+
dataFrame = pd.read_csv('temp.csv')
|
6 |
+
return dataFrame
|
7 |
+
|
8 |
+
|
app.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import streamlit as st
|
2 |
-
from screen_add_note import screen_add_main
|
3 |
-
from screen_scan import screen_scan_main
|
4 |
-
from screen_note import screen_note_main
|
5 |
from streamlit_option_menu import option_menu
|
6 |
|
7 |
def local_css(file_name):
|
@@ -18,8 +18,8 @@ def streamlit_menu(example=3):
|
|
18 |
# 2. horizontal menu with custom style
|
19 |
selected = option_menu(
|
20 |
menu_title=None, # required
|
21 |
-
options=["Optik Okuma", "
|
22 |
-
icons=["house", "book", "envelope"],
|
23 |
default_index=0, # optional
|
24 |
orientation="horizontal",
|
25 |
styles={
|
@@ -46,9 +46,11 @@ def main():
|
|
46 |
|
47 |
if selected == "Optik Okuma":
|
48 |
screen_scan_main()
|
49 |
-
if selected == "
|
50 |
screen_add_main()
|
51 |
-
if selected == "Not
|
|
|
|
|
52 |
screen_note_main()
|
53 |
|
54 |
|
|
|
1 |
import streamlit as st
|
2 |
+
from screen.screen_add_note import screen_add_main
|
3 |
+
from screen.screen_scan import screen_scan_main
|
4 |
+
from screen.screen_note import screen_note_main
|
5 |
from streamlit_option_menu import option_menu
|
6 |
|
7 |
def local_css(file_name):
|
|
|
18 |
# 2. horizontal menu with custom style
|
19 |
selected = option_menu(
|
20 |
menu_title=None, # required
|
21 |
+
options=["Optik Okuma", "Not Girisi", "Not Duzenleme","Analiz"], # required
|
22 |
+
icons=["house", "book", "envelope","envelope"],
|
23 |
default_index=0, # optional
|
24 |
orientation="horizontal",
|
25 |
styles={
|
|
|
46 |
|
47 |
if selected == "Optik Okuma":
|
48 |
screen_scan_main()
|
49 |
+
if selected == "Not Girisi":
|
50 |
screen_add_main()
|
51 |
+
if selected == "Not Duzenleme":
|
52 |
+
screen_note_main()
|
53 |
+
if selected == "Analiz":
|
54 |
screen_note_main()
|
55 |
|
56 |
|
cevapanahtari/cevapanahtari_ders1.txt
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
1 a
|
2 |
+
2 a
|
3 |
+
3 c
|
4 |
+
4 d
|
5 |
+
5 c
|
6 |
+
6 b
|
7 |
+
7 e
|
8 |
+
8 a
|
9 |
+
9 b
|
10 |
+
10 c
|
11 |
+
11 d
|
12 |
+
12 d
|
13 |
+
13 c
|
14 |
+
14 b
|
15 |
+
15 b
|
16 |
+
16 e
|
17 |
+
17 c
|
18 |
+
18 b
|
19 |
+
19 a
|
20 |
+
20 a
|
cevapanahtari/cevapanahtari_ders2.txt
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
1 b
|
2 |
+
2 c
|
3 |
+
3 b
|
4 |
+
4 a
|
5 |
+
5 a
|
6 |
+
6 e
|
7 |
+
7 d
|
8 |
+
8 a
|
9 |
+
9 b
|
10 |
+
10 c
|
11 |
+
11 b
|
12 |
+
12 d
|
13 |
+
13 d
|
14 |
+
14 e
|
15 |
+
15 b
|
16 |
+
16 b
|
17 |
+
17 a
|
18 |
+
18 c
|
19 |
+
19 d
|
20 |
+
20 b
|
cevapanahtari/cevapanahtari_ders3.txt
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
1 a
|
2 |
+
2 b
|
3 |
+
3 a
|
4 |
+
4 a
|
5 |
+
5 e
|
6 |
+
6 d
|
7 |
+
7 c
|
8 |
+
8 c
|
9 |
+
9 b
|
10 |
+
10 b
|
11 |
+
11 e
|
12 |
+
12 d
|
13 |
+
13 c
|
14 |
+
14 b
|
15 |
+
15 c
|
16 |
+
16 a
|
17 |
+
17 b
|
18 |
+
18 d
|
19 |
+
19 c
|
20 |
+
20 b
|
data
CHANGED
@@ -1 +1 @@
|
|
1 |
-
Subproject commit
|
|
|
1 |
+
Subproject commit e29ebebe3fcb37c4ac9e61991f29a7924b5890e1
|
data_func.py
CHANGED
@@ -28,8 +28,8 @@ def make_new_data(sinif_kodu,ogrenci_no,ders_kodu,notu,yanlislar):
|
|
28 |
new_data = pd.DataFrame([yeni_satir])
|
29 |
return new_data
|
30 |
|
31 |
-
def update(new_data,
|
32 |
-
updated_df = pd.concat([
|
33 |
return updated_df
|
34 |
|
35 |
def save_and_push(dataFrame,repo):
|
|
|
28 |
new_data = pd.DataFrame([yeni_satir])
|
29 |
return new_data
|
30 |
|
31 |
+
def update(new_data, ex_df):
|
32 |
+
updated_df = pd.concat([ex_df, new_data])
|
33 |
return updated_df
|
34 |
|
35 |
def save_and_push(dataFrame,repo):
|
denemeler/100luk_numarali.jpg
DELETED
Binary file (72.9 kB)
|
|
denemeler/bossikli.jpg
DELETED
Binary file (74.1 kB)
|
|
functions.py
CHANGED
@@ -84,6 +84,17 @@ def grading(answers,num_questions,myAnswers):
|
|
84 |
else:
|
85 |
grading.append(0)
|
86 |
wrong_ans.append(x+1)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
87 |
score = (sum(grading)/num_questions)*100
|
88 |
return score ,wrong_ans
|
89 |
|
@@ -179,7 +190,7 @@ def image_show(images):
|
|
179 |
st.header("2")
|
180 |
st.image(images[2],width=200)
|
181 |
|
182 |
-
col4, col5
|
183 |
|
184 |
with col4:
|
185 |
st.header("3")
|
@@ -187,10 +198,12 @@ def image_show(images):
|
|
187 |
with col5:
|
188 |
st.header("4")
|
189 |
st.image(images[5],width=200)
|
|
|
190 |
with col6:
|
191 |
st.header("5")
|
192 |
-
st.image(images[6],width=
|
|
|
193 |
with col7:
|
194 |
st.header("6")
|
195 |
-
st.image(images[7],width=
|
196 |
|
|
|
84 |
else:
|
85 |
grading.append(0)
|
86 |
wrong_ans.append(x+1)
|
87 |
+
if myAnswers[x]== 1:
|
88 |
+
wrong_ans.append("A")
|
89 |
+
if myAnswers[x]== 2:
|
90 |
+
wrong_ans.append("B")
|
91 |
+
if myAnswers[x]== 3:
|
92 |
+
wrong_ans.append("C")
|
93 |
+
if myAnswers[x]== 4:
|
94 |
+
wrong_ans.append("D")
|
95 |
+
if myAnswers[x]== 5:
|
96 |
+
wrong_ans.append("E")
|
97 |
+
|
98 |
score = (sum(grading)/num_questions)*100
|
99 |
return score ,wrong_ans
|
100 |
|
|
|
190 |
st.header("2")
|
191 |
st.image(images[2],width=200)
|
192 |
|
193 |
+
col4, col5= st.columns(2)
|
194 |
|
195 |
with col4:
|
196 |
st.header("3")
|
|
|
198 |
with col5:
|
199 |
st.header("4")
|
200 |
st.image(images[5],width=200)
|
201 |
+
col6, col7= st.columns(2)
|
202 |
with col6:
|
203 |
st.header("5")
|
204 |
+
st.image(images[6],width=150)
|
205 |
+
|
206 |
with col7:
|
207 |
st.header("6")
|
208 |
+
st.image(images[7],width=150)
|
209 |
|
optic1.py
CHANGED
@@ -11,10 +11,18 @@ choices=6
|
|
11 |
|
12 |
|
13 |
|
14 |
-
def optic1(
|
15 |
#cevap anahtarini dosyadan okuma ve sayiya cevirme
|
16 |
-
|
17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
|
19 |
#perspektif islemleri icin cozunurluk
|
20 |
wrap_h = 18*20
|
@@ -42,29 +50,27 @@ def optic1(ans_txt,pathImage, save_images= True):
|
|
42 |
rectCon = functions.rectContour(contours)
|
43 |
biggestContour = functions.getCornerPoints(rectCon[0])
|
44 |
secondContour = functions.getCornerPoints(rectCon[1])
|
45 |
-
|
46 |
-
|
47 |
|
48 |
#main
|
49 |
if biggestContour.size != 0 and secondContour.size != 0:
|
50 |
|
51 |
cv2.drawContours(imgBiggestContour, biggestContour,-1,(0,255,0),20)
|
52 |
cv2.drawContours(imgBiggestContour, secondContour,-1,(255,0,0),20) #sondk' kalinlik ortada renk
|
53 |
-
|
54 |
-
|
55 |
|
56 |
biggestContour=functions.reorder(biggestContour)
|
57 |
#cevap siklari icin -************************************************************
|
58 |
pts1 = np.float32(biggestContour)
|
59 |
pts2 = np.float32([[0, 0],[wrap_v, 0], [0, wrap_h],[wrap_v, wrap_h]])
|
60 |
matrix = cv2.getPerspectiveTransform(pts1, pts2)
|
61 |
-
|
62 |
imgWarpColored_1 = cv2.warpPerspective(img, matrix, (wrap_v, wrap_h))
|
63 |
imgWarpGray_1 = cv2.cvtColor(imgWarpColored_1,cv2.COLOR_BGR2GRAY)
|
64 |
-
|
65 |
-
|
66 |
-
imgThresh_1 = cv2.threshold(imgWarpGray_1,0,255,cv2.THRESH_BINARY_INV + cv2.THRESH_OTSU)[1]
|
67 |
-
|
68 |
#second buyuk icin perspektif
|
69 |
secondContour=functions.reorder(secondContour)
|
70 |
pts1_2 = np.float32(secondContour)
|
@@ -73,8 +79,7 @@ def optic1(ans_txt,pathImage, save_images= True):
|
|
73 |
imgWarpColored_2 = cv2.warpPerspective(img, matrix_2, (wrap_v, wrap_h))
|
74 |
imgWarpGray_2 = cv2.cvtColor(imgWarpColored_2,cv2.COLOR_BGR2GRAY)
|
75 |
#imgThresh_2 = cv2.threshold(imgWarpGray_2, 170, 255,cv2.THRESH_BINARY_INV )[1]
|
76 |
-
|
77 |
-
imgThresh_2 = cv2.threshold(imgWarpGray_2,0,255,cv2.THRESH_BINARY_INV + cv2.THRESH_OTSU)[1]
|
78 |
|
79 |
#student id
|
80 |
bubbles = functions.split_num(imgThresh_2, 10, 10)
|
@@ -88,9 +93,22 @@ def optic1(ans_txt,pathImage, save_images= True):
|
|
88 |
boxes_1 = functions.splitBoxes(column_3[0])
|
89 |
boxes_2 = functions.splitBoxes(column_3[1])
|
90 |
boxes_3 = functions.splitBoxes(column_3[2])
|
91 |
-
|
92 |
-
|
93 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
94 |
student_idFix = ""
|
95 |
for number in student_id:
|
96 |
|
@@ -100,7 +118,8 @@ def optic1(ans_txt,pathImage, save_images= True):
|
|
100 |
cv2.imwrite(f"images/{student_idFix}___{i}.jpg",resim_listesi[i])
|
101 |
|
102 |
resim_listesi = [img,imgGray,imgBlur,imgCanny,imgContours,imgBiggestContour,imgThresh_1,imgThresh_2]
|
103 |
-
|
|
|
104 |
return grading, wrong_ans, student_idFix, resim_listesi
|
105 |
|
106 |
#sonuc = optic1(ans_txt="cevapanahtari.txt",pathImage= "denemeler/100luk_numarali.jpg")
|
|
|
11 |
|
12 |
|
13 |
|
14 |
+
def optic1(ans_txt1,ans_txt2,ans_txt3,pathImage, save_images= True):
|
15 |
#cevap anahtarini dosyadan okuma ve sayiya cevirme
|
16 |
+
ans_abc_1 = functions.read_answers(ans_txt1)
|
17 |
+
ans_1 = functions.answers2numbers(ans_abc_1)
|
18 |
+
|
19 |
+
ans_abc_2 = functions.read_answers(ans_txt2)
|
20 |
+
ans_2 = functions.answers2numbers(ans_abc_2)
|
21 |
+
|
22 |
+
ans_abc_3 = functions.read_answers(ans_txt3)
|
23 |
+
ans_3 = functions.answers2numbers(ans_abc_3)
|
24 |
+
|
25 |
+
|
26 |
|
27 |
#perspektif islemleri icin cozunurluk
|
28 |
wrap_h = 18*20
|
|
|
50 |
rectCon = functions.rectContour(contours)
|
51 |
biggestContour = functions.getCornerPoints(rectCon[0])
|
52 |
secondContour = functions.getCornerPoints(rectCon[1])
|
53 |
+
thirdContour = functions.getCornerPoints(rectCon[2])
|
54 |
+
fourthContour = functions.getCornerPoints(rectCon[3])
|
55 |
|
56 |
#main
|
57 |
if biggestContour.size != 0 and secondContour.size != 0:
|
58 |
|
59 |
cv2.drawContours(imgBiggestContour, biggestContour,-1,(0,255,0),20)
|
60 |
cv2.drawContours(imgBiggestContour, secondContour,-1,(255,0,0),20) #sondk' kalinlik ortada renk
|
61 |
+
cv2.drawContours(imgBiggestContour, thirdContour,-1,(0,0,255),20) #sondk' kalinlik ortada renk
|
62 |
+
cv2.drawContours(imgBiggestContour, fourthContour,-1,(0,0,20),20) #sondk' kalinlik ortada renk
|
63 |
|
64 |
biggestContour=functions.reorder(biggestContour)
|
65 |
#cevap siklari icin -************************************************************
|
66 |
pts1 = np.float32(biggestContour)
|
67 |
pts2 = np.float32([[0, 0],[wrap_v, 0], [0, wrap_h],[wrap_v, wrap_h]])
|
68 |
matrix = cv2.getPerspectiveTransform(pts1, pts2)
|
69 |
+
|
70 |
imgWarpColored_1 = cv2.warpPerspective(img, matrix, (wrap_v, wrap_h))
|
71 |
imgWarpGray_1 = cv2.cvtColor(imgWarpColored_1,cv2.COLOR_BGR2GRAY)
|
72 |
+
imgThresh_1 = cv2.threshold(imgWarpGray_1,0,255,cv2.THRESH_BINARY_INV + cv2.THRESH_OTSU)[1]
|
73 |
+
|
|
|
|
|
74 |
#second buyuk icin perspektif
|
75 |
secondContour=functions.reorder(secondContour)
|
76 |
pts1_2 = np.float32(secondContour)
|
|
|
79 |
imgWarpColored_2 = cv2.warpPerspective(img, matrix_2, (wrap_v, wrap_h))
|
80 |
imgWarpGray_2 = cv2.cvtColor(imgWarpColored_2,cv2.COLOR_BGR2GRAY)
|
81 |
#imgThresh_2 = cv2.threshold(imgWarpGray_2, 170, 255,cv2.THRESH_BINARY_INV )[1]
|
82 |
+
imgThresh_2 = cv2.threshold(imgWarpGray_2,0,255,cv2.THRESH_BINARY_INV + cv2.THRESH_OTSU)[1]
|
|
|
83 |
|
84 |
#student id
|
85 |
bubbles = functions.split_num(imgThresh_2, 10, 10)
|
|
|
93 |
boxes_1 = functions.splitBoxes(column_3[0])
|
94 |
boxes_2 = functions.splitBoxes(column_3[1])
|
95 |
boxes_3 = functions.splitBoxes(column_3[2])
|
96 |
+
#boxes_1
|
97 |
+
myPixelVal_1 = functions.pixelVal(questions,choices,boxes_1)
|
98 |
+
myIndex_1 = functions.user_answers(questions,myPixelVal_1)
|
99 |
+
grading_1, wrong_ans_1 = functions.grading(ans_1,questions,myIndex_1)
|
100 |
+
|
101 |
+
#boxes_2
|
102 |
+
myPixelVal_2 = functions.pixelVal(questions,choices,boxes_2)
|
103 |
+
myIndex_2 = functions.user_answers(questions,myPixelVal_2)
|
104 |
+
grading_2, wrong_ans_2 = functions.grading(ans_2,questions,myIndex_2)
|
105 |
+
|
106 |
+
#boxes_3
|
107 |
+
myPixelVal_3 = functions.pixelVal(questions,choices,boxes_3)
|
108 |
+
myIndex_3 = functions.user_answers(questions,myPixelVal_3)
|
109 |
+
grading_3, wrong_ans_3 = functions.grading(ans_3,questions,myIndex_3)
|
110 |
+
|
111 |
+
|
112 |
student_idFix = ""
|
113 |
for number in student_id:
|
114 |
|
|
|
118 |
cv2.imwrite(f"images/{student_idFix}___{i}.jpg",resim_listesi[i])
|
119 |
|
120 |
resim_listesi = [img,imgGray,imgBlur,imgCanny,imgContours,imgBiggestContour,imgThresh_1,imgThresh_2]
|
121 |
+
grading = [grading_1,grading_2,grading_3]
|
122 |
+
wrong_ans = [wrong_ans_1,wrong_ans_2,wrong_ans_3]
|
123 |
return grading, wrong_ans, student_idFix, resim_listesi
|
124 |
|
125 |
#sonuc = optic1(ans_txt="cevapanahtari.txt",pathImage= "denemeler/100luk_numarali.jpg")
|
requirements.txt
CHANGED
@@ -6,5 +6,4 @@ huggingface_hub
|
|
6 |
opencv-python-headless==4.4.0.42
|
7 |
pickleshare == 0.7.5
|
8 |
requests == 2.24.0
|
9 |
-
scikit-image == 0.19.3
|
10 |
-
streamlit_option_menu
|
|
|
6 |
opencv-python-headless==4.4.0.42
|
7 |
pickleshare == 0.7.5
|
8 |
requests == 2.24.0
|
9 |
+
scikit-image == 0.19.3
|
|
screen/__pycache__/screen_add_note.cpython-310.pyc
ADDED
Binary file (1.04 kB). View file
|
|
screen/__pycache__/screen_note.cpython-310.pyc
ADDED
Binary file (598 Bytes). View file
|
|
screen/__pycache__/screen_scan.cpython-310.pyc
ADDED
Binary file (1.91 kB). View file
|
|
screen/screen_about.py
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""""
|
2 |
+
Ornek Pdfler
|
3 |
+
Nasıl KUllanılmalı gıbı seyler yaz
|
4 |
+
|
5 |
+
"""
|
screen_add_note.py → screen/screen_add_note.py
RENAMED
@@ -5,10 +5,10 @@ from data_func import DATASET_REPO_URL,DATA_FILENAME,DATA_FILE,HF_TOKEN
|
|
5 |
|
6 |
|
7 |
|
|
|
8 |
def screen_add_main():
|
9 |
st.title("Not Giris")
|
10 |
repo, repo_df = data_func.pull_read()
|
11 |
-
|
12 |
# Kullanıcıdan verileri alma
|
13 |
sinif_kodu = st.text_input("Sınıf Kodu")
|
14 |
ogrenci_no = st.text_input("Öğrenci No")
|
|
|
5 |
|
6 |
|
7 |
|
8 |
+
|
9 |
def screen_add_main():
|
10 |
st.title("Not Giris")
|
11 |
repo, repo_df = data_func.pull_read()
|
|
|
12 |
# Kullanıcıdan verileri alma
|
13 |
sinif_kodu = st.text_input("Sınıf Kodu")
|
14 |
ogrenci_no = st.text_input("Öğrenci No")
|
screen/screen_analysis.py
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
import pandas as pd
|
3 |
+
import data_func
|
4 |
+
from data_func import DATASET_REPO_URL,DATA_FILENAME,DATA_FILE,HF_TOKEN
|
5 |
+
|
6 |
+
|
7 |
+
|
8 |
+
def screen_analysis_main():
|
9 |
+
#repo, repo_df = data_func.pull_read()
|
10 |
+
#ogrenci_no = st.text_input("Öğrenci No")
|
11 |
+
#filtered_df = repo_df[(repo_df['sinif_no'] == 3) & (repo_df['not'] > 70)]
|
12 |
+
dataFrame = pd.read_csv('temp.csv')
|
13 |
+
|
14 |
+
|
15 |
+
|
16 |
+
if __name__ == "__main__":
|
17 |
+
screen_analysis_main()
|
screen_note.py → screen/screen_note.py
RENAMED
@@ -4,16 +4,12 @@ import data_func
|
|
4 |
from data_func import DATASET_REPO_URL,DATA_FILENAME,DATA_FILE,HF_TOKEN
|
5 |
|
6 |
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
def screen_note_main():
|
12 |
-
|
13 |
repo, repo_df = data_func.pull_read()
|
|
|
14 |
st.subheader("Girilen Veriler")
|
15 |
-
st.
|
16 |
-
|
17 |
|
18 |
if __name__ == "__main__":
|
19 |
screen_note_main()
|
|
|
4 |
from data_func import DATASET_REPO_URL,DATA_FILENAME,DATA_FILE,HF_TOKEN
|
5 |
|
6 |
|
|
|
|
|
|
|
|
|
7 |
def screen_note_main():
|
|
|
8 |
repo, repo_df = data_func.pull_read()
|
9 |
+
|
10 |
st.subheader("Girilen Veriler")
|
11 |
+
st.dataframe(repo_df,use_container_width=True)
|
12 |
+
#filtered_df = repo_df[(repo_df['sinif_no'] == 3) & (repo_df['not'] > 70)]
|
13 |
|
14 |
if __name__ == "__main__":
|
15 |
screen_note_main()
|
screen/screen_scan.py
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import csv
|
2 |
+
import streamlit as st
|
3 |
+
import numpy as np
|
4 |
+
import cv2
|
5 |
+
from PIL import Image
|
6 |
+
import optic1
|
7 |
+
from functions import image_show
|
8 |
+
import pandas as pd
|
9 |
+
from data_func import make_new_data,update
|
10 |
+
|
11 |
+
@st.cache
|
12 |
+
def convert_df_to_csv(df):
|
13 |
+
# IMPORTANT: Cache the conversion to prevent computation on every rerun
|
14 |
+
return df.to_csv().encode('utf-8')
|
15 |
+
|
16 |
+
def screen_scan_main():
|
17 |
+
st.title("Optik Okuma")
|
18 |
+
dataFrame = pd.read_csv('data/temp.csv')
|
19 |
+
sinif_kodu = int(st.text_input("Sınıf Kodu",value=10))
|
20 |
+
ders_kodu = int(st.text_input("Ders Kodu",value=10))
|
21 |
+
image_file = st.file_uploader(
|
22 |
+
"Upload image for testing", type=['jpeg', 'png', 'jpg', 'webp'])
|
23 |
+
st.dataframe(dataFrame)
|
24 |
+
|
25 |
+
if image_file != None:
|
26 |
+
image = Image.open(image_file)
|
27 |
+
image = np.array(image.convert('RGB'))
|
28 |
+
|
29 |
+
if st.button("Process"):
|
30 |
+
#(ans_txt,pathImage, save_images= True)
|
31 |
+
grading, wrong_ans, student_idFix, resim_list =optic1.optic1(ans_txt1="cevapanahtari/cevapanahtari_ders1.txt",
|
32 |
+
ans_txt2="cevapanahtari/cevapanahtari_ders2.txt",
|
33 |
+
ans_txt3="cevapanahtari/cevapanahtari_ders3.txt",
|
34 |
+
pathImage=image,save_images=False)
|
35 |
+
|
36 |
+
image_show(resim_list)
|
37 |
+
|
38 |
+
st.write("Notu:",grading[0])
|
39 |
+
st.write("Yanlis Yaptigi sorular:",wrong_ans[0])
|
40 |
+
st.write("Ogrenci Numarasi:",student_idFix)
|
41 |
+
new_data = make_new_data(sinif_kodu=sinif_kodu,ders_kodu=ders_kodu, ogrenci_no=int(student_idFix),
|
42 |
+
notu=grading[0],yanlislar=wrong_ans[0])
|
43 |
+
|
44 |
+
st.dataframe(new_data)
|
45 |
+
updated = update(new_data=new_data,ex_df=dataFrame)
|
46 |
+
st.dataframe(updated,use_container_width=True)
|
47 |
+
updated.to_csv("data/temp.csv",index=False)
|
48 |
+
|
49 |
+
st.download_button(label="Download data as CSV",data=convert_df_to_csv(updated),
|
50 |
+
file_name='large_df.csv',mime='text/csv',)
|
51 |
+
|
52 |
+
|
53 |
+
#python -m streamlit run app.py
|
54 |
+
if __name__ == '__main__':
|
55 |
+
screen_scan_main()
|
screen_scan.py
DELETED
@@ -1,33 +0,0 @@
|
|
1 |
-
import streamlit as st
|
2 |
-
import numpy as np
|
3 |
-
import cv2
|
4 |
-
from PIL import Image
|
5 |
-
import optic1
|
6 |
-
from functions import image_show
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
def screen_scan_main():
|
12 |
-
st.title("Optik Okuma")
|
13 |
-
|
14 |
-
image_file = st.file_uploader(
|
15 |
-
"Upload image for testing", type=['jpeg', 'png', 'jpg', 'webp'])
|
16 |
-
if image_file != None:
|
17 |
-
image = Image.open(image_file)
|
18 |
-
image = np.array(image.convert('RGB'))
|
19 |
-
if st.button("Process"):
|
20 |
-
#(ans_txt,pathImage, save_images= True)
|
21 |
-
grading, wrong_ans, student_idFix, resim_list =optic1.optic1(ans_txt="cevapanahtari.txt",pathImage=image,save_images=False)
|
22 |
-
|
23 |
-
image_show(resim_list)
|
24 |
-
grading = str(grading)
|
25 |
-
wrong_ans = str(wrong_ans)
|
26 |
-
#student_idFix = str(student_idFix)
|
27 |
-
st.write("Notu:",grading)
|
28 |
-
st.write("Yanlis Yaptigi sorular:",wrong_ans)
|
29 |
-
st.write("Ogrenci Numarasi:",student_idFix)
|
30 |
-
|
31 |
-
#python -m streamlit run app.py
|
32 |
-
if __name__ == '__main__':
|
33 |
-
screen_scan_main()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
toDo.txt
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
wrong_ans gibi yaninda siklarinida kaydetsin
|
2 |
+
scan ettikten sonra verileri son kez sorsun ve veri tabanina kaydetsin
|
3 |
+
analiz sayfasi
|
4 |
+
ornek optikler icin sayfa ki kullanmak isteyen cikartsin
|
5 |
+
|
6 |
+
#-------------------------------------------
|
7 |
+
dersin hangi ders hanagi sinavi oldugu konusu
|
8 |
+
scan sayfasindan etiket secilip o sekilde kaydedilebilir
|
9 |
+
optikten okumak gerekmez optik uzerinde elle yazilmasi yeterli olur
|
10 |
+
o elle yazilan yerde buyutulur veya sayi olarak kodlanabilir bunlar kodlamaya gore sayisal
|
11 |
+
degerine gore hangi ders hangi sinav oldugu belli olur
|