Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from huggingface_hub import from_pretrained_fastai
|
2 |
+
import gradio as gr
|
3 |
+
from fastai.vision.all import *
|
4 |
+
import os
|
5 |
+
import shutil
|
6 |
+
from os import path
|
7 |
+
from zipfile import ZipFile
|
8 |
+
from shutil import make_archive
|
9 |
+
import imutils
|
10 |
+
import time
|
11 |
+
import dlib
|
12 |
+
import cv2
|
13 |
+
from google.colab.patches import cv2_imshow
|
14 |
+
import os
|
15 |
+
from imutils import paths
|
16 |
+
import numpy as np
|
17 |
+
import pickle
|
18 |
+
import vptree
|
19 |
+
|
20 |
+
args = {}
|
21 |
+
|
22 |
+
|
23 |
+
# VP tree output file
|
24 |
+
args["tree"] = "tree.pickle"
|
25 |
+
|
26 |
+
# Hash dictionary output file
|
27 |
+
args["hashes"] = "hashesCaras.pickle"
|
28 |
+
|
29 |
+
|
30 |
+
# Hamming distance threshold
|
31 |
+
args["distance"] = 10
|
32 |
+
|
33 |
+
|
34 |
+
def FaceDetect(img):
|
35 |
+
|
36 |
+
|
37 |
+
|
38 |
+
|
39 |
+
|
40 |
+
# Creamos la interfaz y la lanzamos.
|
41 |
+
gr.Interface(fn=FaceDetect, inputs=gr.inputs.Image(shape=(128, 128)), outputs=gr.outputs.Label(num_top_classes=3),examples=['Pawn.jpg','Knight.jpg']).launch(share=False)
|