Update app.py
Browse files
app.py
CHANGED
@@ -10,8 +10,6 @@ from typing import Optional
|
|
10 |
|
11 |
logging.basicConfig(level=logging.INFO)
|
12 |
|
13 |
-
req = 0
|
14 |
-
|
15 |
def grab_faces(img: np.ndarray) -> Optional[np.ndarray]:
|
16 |
cascades = [
|
17 |
"haarcascade_frontalface_default.xml",
|
@@ -74,8 +72,6 @@ processor = ViTImageProcessor.from_pretrained("ongkn/attraction-classifier")
|
|
74 |
pipe = pipeline("image-classification", model=model, feature_extractor=processor)
|
75 |
|
76 |
def classify_image(input):
|
77 |
-
global req
|
78 |
-
req += 1
|
79 |
face = grab_faces(np.array(input))
|
80 |
if face is None:
|
81 |
return "No face detected", 0, input
|
|
|
10 |
|
11 |
logging.basicConfig(level=logging.INFO)
|
12 |
|
|
|
|
|
13 |
def grab_faces(img: np.ndarray) -> Optional[np.ndarray]:
|
14 |
cascades = [
|
15 |
"haarcascade_frontalface_default.xml",
|
|
|
72 |
pipe = pipeline("image-classification", model=model, feature_extractor=processor)
|
73 |
|
74 |
def classify_image(input):
|
|
|
|
|
75 |
face = grab_faces(np.array(input))
|
76 |
if face is None:
|
77 |
return "No face detected", 0, input
|