Spaces:
Running
Running
Update index.html
Browse files- index.html +3 -3
index.html
CHANGED
@@ -21,12 +21,12 @@ transformers = await import_transformers_js()
|
|
21 |
pipeline = transformers.pipeline
|
22 |
pipe = await pipeline('zero-shot-image-classification')
|
23 |
|
24 |
-
async def
|
25 |
-
data = await pipe(
|
26 |
result = [{item['label']: round(item['score'], 2) for item in data}]
|
27 |
return result
|
28 |
|
29 |
-
demo = gr.Interface(transcribe, [gr.Image(label="Input image"), gr.Textbox(label="Classes")], gr.Label())
|
30 |
demo.launch()
|
31 |
</gradio-file>
|
32 |
|
|
|
21 |
pipeline = transformers.pipeline
|
22 |
pipe = await pipeline('zero-shot-image-classification')
|
23 |
|
24 |
+
async def classify(image, classes):
|
25 |
+
data = await pipe(image, classes.split(","))
|
26 |
result = [{item['label']: round(item['score'], 2) for item in data}]
|
27 |
return result
|
28 |
|
29 |
+
demo = gr.Interface(transcribe, [gr.Image(label="Input image", type="filepath"), gr.Textbox(label="Classes separated by commas")], gr.Label())
|
30 |
demo.launch()
|
31 |
</gradio-file>
|
32 |
|