Spaces:
Paused
Paused
Commit ·
d53cee4
1
Parent(s): 6204542
clean: remove unused efficientnet import
Browse files
app/services/prediction_service.py
CHANGED
|
@@ -22,9 +22,6 @@ from tensorflow.keras.applications.convnext import (
|
|
| 22 |
from tensorflow.keras.applications.inception_v3 import (
|
| 23 |
preprocess_input as inception_preprocess,
|
| 24 |
)
|
| 25 |
-
from tensorflow.keras.applications.efficientnet import (
|
| 26 |
-
preprocess_input as efficientnet_preprocess,
|
| 27 |
-
)
|
| 28 |
|
| 29 |
|
| 30 |
class RandomShear(layers.Layer):
|
|
@@ -178,10 +175,14 @@ class MultiModelPredictor:
|
|
| 178 |
filename=filename,
|
| 179 |
token=settings.HF,
|
| 180 |
)
|
| 181 |
-
return load_model(
|
|
|
|
|
|
|
| 182 |
except Exception as e:
|
| 183 |
if attempt < retries - 1:
|
| 184 |
-
print(
|
|
|
|
|
|
|
| 185 |
time.sleep(delay)
|
| 186 |
else:
|
| 187 |
print(f"[ERROR] Exhausted retries for {filename}.")
|
|
@@ -365,7 +366,7 @@ class MultiModelPredictor:
|
|
| 365 |
hairstyle_res = future_hairstyle.result()
|
| 366 |
# Hair color is dependent on hairstyle
|
| 367 |
haircolor_res = run_haircolor(hairstyle_res)
|
| 368 |
-
|
| 369 |
res_age = future_age.result()
|
| 370 |
res_gender = future_gender.result()
|
| 371 |
res_eyebrows = future_eyebrows.result()
|
|
|
|
| 22 |
from tensorflow.keras.applications.inception_v3 import (
|
| 23 |
preprocess_input as inception_preprocess,
|
| 24 |
)
|
|
|
|
|
|
|
|
|
|
| 25 |
|
| 26 |
|
| 27 |
class RandomShear(layers.Layer):
|
|
|
|
| 175 |
filename=filename,
|
| 176 |
token=settings.HF,
|
| 177 |
)
|
| 178 |
+
return load_model(
|
| 179 |
+
path, custom_objects={"RandomShear": RandomShear}
|
| 180 |
+
)
|
| 181 |
except Exception as e:
|
| 182 |
if attempt < retries - 1:
|
| 183 |
+
print(
|
| 184 |
+
f"[WARNING] Download failed for {filename}. Retrying in {delay}s..."
|
| 185 |
+
)
|
| 186 |
time.sleep(delay)
|
| 187 |
else:
|
| 188 |
print(f"[ERROR] Exhausted retries for {filename}.")
|
|
|
|
| 366 |
hairstyle_res = future_hairstyle.result()
|
| 367 |
# Hair color is dependent on hairstyle
|
| 368 |
haircolor_res = run_haircolor(hairstyle_res)
|
| 369 |
+
|
| 370 |
res_age = future_age.result()
|
| 371 |
res_gender = future_gender.result()
|
| 372 |
res_eyebrows = future_eyebrows.result()
|