Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -210,6 +210,8 @@ class options:
|
|
210 |
self.no_trace=no_trace
|
211 |
|
212 |
def get_output(input_image):
|
|
|
|
|
213 |
input_image.save(f"{BASE_DIR}/input/image.jpg")
|
214 |
source = f"{BASE_DIR}/input"
|
215 |
opt = options(weights='logo_detection.pt',source=source)
|
@@ -222,5 +224,5 @@ def get_output(input_image):
|
|
222 |
return input_image
|
223 |
|
224 |
|
225 |
-
demo = gr.Interface(fn=get_output,
|
226 |
demo.launch(debug=True)
|
|
|
210 |
self.no_trace=no_trace
|
211 |
|
212 |
def get_output(input_image):
|
213 |
+
### Numpy -> PIL
|
214 |
+
input_image = Image.fromarray(input_image).convert('RGB')
|
215 |
input_image.save(f"{BASE_DIR}/input/image.jpg")
|
216 |
source = f"{BASE_DIR}/input"
|
217 |
opt = options(weights='logo_detection.pt',source=source)
|
|
|
224 |
return input_image
|
225 |
|
226 |
|
227 |
+
demo = gr.Interface(fn=get_output, inputs="image", outputs="image")
|
228 |
demo.launch(debug=True)
|