Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,10 +5,21 @@ import streamlit as st
|
|
| 5 |
from streamlit_webrtc import webrtc_streamer, VideoTransformerBase
|
| 6 |
import numpy as np
|
| 7 |
import os
|
|
|
|
| 8 |
|
| 9 |
# # Set the Tesseract path for Hugging Face Spaces (assuming Tesseract is installed)
|
| 10 |
pytesseract.pytesseract.tesseract_cmd = 'tesseract'
|
| 11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
# Streamlit UI
|
| 13 |
st.title("Quiz Checker App")
|
| 14 |
st.header("Upload an Answer Key and Use Webcam for Real-Time Evaluation")
|
|
|
|
| 5 |
from streamlit_webrtc import webrtc_streamer, VideoTransformerBase
|
| 6 |
import numpy as np
|
| 7 |
import os
|
| 8 |
+
import shutil
|
| 9 |
|
| 10 |
# # Set the Tesseract path for Hugging Face Spaces (assuming Tesseract is installed)
|
| 11 |
pytesseract.pytesseract.tesseract_cmd = 'tesseract'
|
| 12 |
|
| 13 |
+
# Check if Tesseract is installed and set the path
|
| 14 |
+
tesseract_path = shutil.which("tesseract")
|
| 15 |
+
|
| 16 |
+
if tesseract_path:
|
| 17 |
+
pytesseract.pytesseract.tesseract_cmd = tesseract_path
|
| 18 |
+
st.success(f"Tesseract found at {tesseract_path}")
|
| 19 |
+
else:
|
| 20 |
+
st.error("Tesseract is not installed or not found in your PATH")
|
| 21 |
+
|
| 22 |
+
|
| 23 |
# Streamlit UI
|
| 24 |
st.title("Quiz Checker App")
|
| 25 |
st.header("Upload an Answer Key and Use Webcam for Real-Time Evaluation")
|