Spaces:
Running
Running
tomas-gajarsky
commited on
Commit
·
b723189
1
Parent(s):
4e60bca
Rename main.py to app.py
Browse files- main.py → app.py +18 -13
main.py → app.py
RENAMED
@@ -21,16 +21,21 @@ def inference(path_image):
|
|
21 |
return pil_image
|
22 |
|
23 |
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
21 |
return pil_image
|
22 |
|
23 |
|
24 |
+
def main():
|
25 |
+
title = "facetorch"
|
26 |
+
description = "Demo for facetorch, a Python library that can detect faces and analyze facial features using deep neural networks. The goal is to gather open sourced face analysis models from the community and optimize them for performance using TorchScrip. Try selecting one of the example images or upload your own."
|
27 |
+
article = "<p style='text-align: center'><a href='https://github.com/tomas-gajarsky/facetorch' target='_blank'>Github Repo</a></p>"
|
28 |
+
|
29 |
+
gr.Interface(
|
30 |
+
inference,
|
31 |
+
[gr.inputs.Image(label="Input")],
|
32 |
+
gr.outputs.Image(type="pil", label="Output"),
|
33 |
+
title=title,
|
34 |
+
description=description,
|
35 |
+
article=article,
|
36 |
+
examples=[["./data/input/test.jpg"], ["./data/input/test2.jpg"]],
|
37 |
+
).launch(debug=True)
|
38 |
+
|
39 |
+
|
40 |
+
if __name__ == "__main__":
|
41 |
+
main()
|