Spaces:
Sleeping
Sleeping
Update Tesseract.js
Browse files- Tesseract.js +2 -38
Tesseract.js
CHANGED
@@ -1,38 +1,5 @@
|
|
1 |
-
|
2 |
-
<html lang="en">
|
3 |
-
<head>
|
4 |
-
<meta charset="UTF-8">
|
5 |
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
-
<title>Candy Label Scanner</title>
|
7 |
-
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/tesseract.min.js"></script>
|
8 |
-
<style>
|
9 |
-
#output {
|
10 |
-
font-size: 20px;
|
11 |
-
margin-top: 20px;
|
12 |
-
}
|
13 |
-
.red {
|
14 |
-
color: red;
|
15 |
-
}
|
16 |
-
.yellow {
|
17 |
-
color: yellow;
|
18 |
-
}
|
19 |
-
.green {
|
20 |
-
color: green;
|
21 |
-
}
|
22 |
-
video {
|
23 |
-
width: 100%;
|
24 |
-
height: auto;
|
25 |
-
}
|
26 |
-
</style>
|
27 |
-
</head>
|
28 |
-
<body>
|
29 |
-
<h1>Candy Label Scanner</h1>
|
30 |
-
<video id="video" autoplay></video>
|
31 |
-
<button id="capture">Capture</button>
|
32 |
-
<canvas id="canvas" style="display: none;"></canvas>
|
33 |
-
<div id="output"></div>
|
34 |
|
35 |
-
<script>
|
36 |
const video = document.getElementById('video');
|
37 |
const canvas = document.getElementById('canvas');
|
38 |
const output = document.getElementById('output');
|
@@ -96,7 +63,4 @@
|
|
96 |
outputDiv.textContent = 'Sugar content not found';
|
97 |
outputDiv.className = '';
|
98 |
}
|
99 |
-
}
|
100 |
-
</script>
|
101 |
-
</body>
|
102 |
-
</html>
|
|
|
1 |
+
import streamlit as st
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
|
|
3 |
const video = document.getElementById('video');
|
4 |
const canvas = document.getElementById('canvas');
|
5 |
const output = document.getElementById('output');
|
|
|
63 |
outputDiv.textContent = 'Sugar content not found';
|
64 |
outputDiv.className = '';
|
65 |
}
|
66 |
+
}
|
|
|
|
|
|