Spaces:
Runtime error
Runtime error
Commit
·
22c29e4
1
Parent(s):
c6a8371
Update app.py
Browse files
app.py
CHANGED
@@ -1,11 +1,13 @@
|
|
1 |
# gr.Interface.load("models/PranomVignesh/Handwritten-Characters").launch()
|
2 |
import gradio as gr
|
3 |
from transformers import pipeline
|
|
|
4 |
|
5 |
imageClassifier = pipeline(task="image-classification",
|
6 |
model="PranomVignesh/Handwritten-Characters")
|
7 |
|
8 |
def predict(image):
|
|
|
9 |
predictions = imageClassifier(image)
|
10 |
output = {}
|
11 |
for item in predictions:
|
|
|
1 |
# gr.Interface.load("models/PranomVignesh/Handwritten-Characters").launch()
|
2 |
import gradio as gr
|
3 |
from transformers import pipeline
|
4 |
+
from PIL import Image
|
5 |
|
6 |
imageClassifier = pipeline(task="image-classification",
|
7 |
model="PranomVignesh/Handwritten-Characters")
|
8 |
|
9 |
def predict(image):
|
10 |
+
input = Image.fromarray(input)
|
11 |
predictions = imageClassifier(image)
|
12 |
output = {}
|
13 |
for item in predictions:
|