Skip to content

Commit f78d1b8

Browse files
committed
change estimator settings
1 parent 37cb2b5 commit f78d1b8

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

age_estimator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66

77
class AgeEstimator:
88
def __init__(
9-
self, ctx_id: int = 0, det_size: tuple[int, int] = (1024, 1024)
9+
self, ctx_id: int = -1, det_size: tuple[int, int] = (640, 640)
1010
) -> None:
1111
self.app = FaceAnalysis(name="buffalo_l") # SOTA Model including age
12-
self.app.prepare(ctx_id=ctx_id, det_size=det_size) # 0 = gpu
12+
self.app.prepare(ctx_id=ctx_id, det_size=det_size) # -1 = CPU, 0+ = GPU
1313

1414
def estimate_age(self, pil_img: Image.Image) -> float | None:
1515
"""

generate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ def generate_images(
229229
age_estimator = None
230230
if weight_vector is not None:
231231
print("Initializing age estimator...")
232-
age_estimator = AgeEstimator(ctx_id=0, det_size=(1024, 1024))
232+
age_estimator = AgeEstimator(ctx_id=-1, det_size=(640, 640))
233233

234234
# Generate images.
235235
all_images = [] # Store images for composite: list of lists (one per seed)

0 commit comments

Comments
 (0)