Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -6,9 +6,10 @@ from concurrent.futures import ThreadPoolExecutor
|
|
6 |
|
7 |
fawkes_protection = FawkesProtection()
|
8 |
|
9 |
-
def process_images(
|
|
|
10 |
with ThreadPoolExecutor() as executor:
|
11 |
-
futures = [executor.submit(fawkes_protection.predict, img,
|
12 |
results = [Image.fromarray(future.result()) for future in futures]
|
13 |
return results
|
14 |
|
|
|
6 |
|
7 |
fawkes_protection = FawkesProtection()
|
8 |
|
9 |
+
def process_images(image_files, protection_level):
|
10 |
+
images = [Image.open(file) for file in image_files]
|
11 |
with ThreadPoolExecutor() as executor:
|
12 |
+
futures = [executor.submit(fawkes_protection.predict, img, protection_level) for img in images]
|
13 |
results = [Image.fromarray(future.result()) for future in futures]
|
14 |
return results
|
15 |
|