Update app.py
Browse files
app.py
CHANGED
|
@@ -3,6 +3,21 @@ import os
|
|
| 3 |
if not os.path.exists("data"):
|
| 4 |
os.mkdir("data")
|
| 5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
import face_recognition
|
| 7 |
|
| 8 |
# Often instead of just checking if two faces match or not (True or False), it's helpful to see how similar they are.
|
|
|
|
| 3 |
if not os.path.exists("data"):
|
| 4 |
os.mkdir("data")
|
| 5 |
|
| 6 |
+
import gdown
|
| 7 |
+
url = 'https://drive.google.com/uc?id=134kOnRcJgHZ2eREu8QRi99qj996Ap_ML'
|
| 8 |
+
output = 'images.csv'
|
| 9 |
+
gdown.download(url, output, quiet=False)
|
| 10 |
+
|
| 11 |
+
import urllib.request
|
| 12 |
+
import pandas
|
| 13 |
+
df = pandas.read_csv(output)
|
| 14 |
+
df = df.drop_duplicates(subset=['name'])
|
| 15 |
+
df = df[:100]
|
| 16 |
+
df = df[df['url'].str.endswith(".jpg")]
|
| 17 |
+
for i, row in df.iterrows():
|
| 18 |
+
urllib.request.urlretrieve(row['url'], f"{row['name']}.jpg")
|
| 19 |
+
|
| 20 |
+
|
| 21 |
import face_recognition
|
| 22 |
|
| 23 |
# Often instead of just checking if two faces match or not (True or False), it's helpful to see how similar they are.
|