vikasdeep commited on
Commit
69ec729
·
verified ·
1 Parent(s): 2741bb8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -2
app.py CHANGED
@@ -1,6 +1,7 @@
1
  import os
2
 
3
- os.system('pip install --force-reinstall gradio==3.39.0')
 
4
  import gradio as gr
5
  import torch
6
  import torch.nn.functional as F
@@ -79,4 +80,12 @@ interface = gr.Interface(
79
  gr.outputs.Label(label="Class"),
80
  gr.outputs.Image(label="Face with Explainability", type="pil")
81
  ],
82
- ).launch()
 
 
 
 
 
 
 
 
 
1
  import os
2
 
3
+ # os.system('pip install --force-reinstall gradio==3.39.0')
4
+ os.system('pip install gradio_client')
5
  import gradio as gr
6
  import torch
7
  import torch.nn.functional as F
 
80
  gr.outputs.Label(label="Class"),
81
  gr.outputs.Image(label="Face with Explainability", type="pil")
82
  ],
83
+ ).launch()
84
+ from gradio_client import Client
85
+
86
+ client = Client("https://vikasdeep-deepfacedetection.hf.space/")
87
+ result = client.predict(
88
+ "https://raw.githubusercontent.com/gradio-app/gradio/main/test/test_files/bus.png", # str (filepath on your computer (or URL) of image) in 'Input Image' Image component
89
+ api_name="/predict"
90
+ )
91
+ print(result)