Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -142,7 +142,7 @@ def skintoneplot(hex_codes):
|
|
| 142 |
return fig
|
| 143 |
|
| 144 |
def age_detector(image):
|
| 145 |
-
pipe = pipeline('image-classification', model="dima806/faces_age_detection", device=
|
| 146 |
result = pipe(image)
|
| 147 |
max_score_item = max(result, key=lambda item: item['score'])
|
| 148 |
return max_score_item['label']
|
|
@@ -160,7 +160,7 @@ def ageplot(agelist):
|
|
| 160 |
return fig
|
| 161 |
|
| 162 |
def is_nsfw(image):
|
| 163 |
-
classifier = pipeline("image-classification", model="Falconsai/nsfw_image_detection")
|
| 164 |
result = classifier(image)
|
| 165 |
max_score_item = max(result, key=lambda item: item['score'])
|
| 166 |
return max_score_item['label']
|
|
|
|
| 142 |
return fig
|
| 143 |
|
| 144 |
def age_detector(image):
|
| 145 |
+
pipe = pipeline('image-classification', model="dima806/faces_age_detection", device="cuda")
|
| 146 |
result = pipe(image)
|
| 147 |
max_score_item = max(result, key=lambda item: item['score'])
|
| 148 |
return max_score_item['label']
|
|
|
|
| 160 |
return fig
|
| 161 |
|
| 162 |
def is_nsfw(image):
|
| 163 |
+
classifier = pipeline("image-classification", model="Falconsai/nsfw_image_detection", device="cuda")
|
| 164 |
result = classifier(image)
|
| 165 |
max_score_item = max(result, key=lambda item: item['score'])
|
| 166 |
return max_score_item['label']
|