Spaces:
Running
Running
updating app
Browse files
app.py
CHANGED
@@ -1,9 +1,8 @@
|
|
1 |
-
|
2 |
from sentence_transformers import util
|
3 |
from transformers import pipeline
|
4 |
from PIL import Image, ImageDraw
|
5 |
from sentence_transformers import util,SentenceTransformer
|
6 |
-
|
7 |
checkpoint = "google/owlvit-base-patch32"
|
8 |
detector = pipeline(model=checkpoint, task="zero-shot-object-detection")
|
9 |
model = SentenceTransformer('clip-ViT-L-14')
|
@@ -46,3 +45,16 @@ def predict(im1, im2,inp_sim):
|
|
46 |
else:
|
47 |
return sim, "DIFFERENT PEOPLE, DON'T UNLOCK"
|
48 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
from sentence_transformers import util
|
2 |
from transformers import pipeline
|
3 |
from PIL import Image, ImageDraw
|
4 |
from sentence_transformers import util,SentenceTransformer
|
5 |
+
import gradio as gr
|
6 |
checkpoint = "google/owlvit-base-patch32"
|
7 |
detector = pipeline(model=checkpoint, task="zero-shot-object-detection")
|
8 |
model = SentenceTransformer('clip-ViT-L-14')
|
|
|
45 |
else:
|
46 |
return sim, "DIFFERENT PEOPLE, DON'T UNLOCK"
|
47 |
|
48 |
+
|
49 |
+
description = "An application that can recognize if two faces belong to the same person or not"
|
50 |
+
title = "Facial Identity Recognition System"
|
51 |
+
|
52 |
+
interface = gr.Interface(fn=predict,
|
53 |
+
inputs= [gr.Image(type="pil", source="webcam"),
|
54 |
+
gr.Image(type="pil"),
|
55 |
+
gr.Slider(0, 1, value=0.8, label="Similarity Percentage", info="Choose betwen 0 and 1")],
|
56 |
+
outputs= [gr.Number(label="Similarity"),
|
57 |
+
gr.Textbox(label="Message")]
|
58 |
+
)
|
59 |
+
|
60 |
+
interface.launch(debug=True)
|