def assign_faces(officer, images): random_int = random.uniform(0, 1) if random_int >= 0.5: return models.Face(officer_id=officer.id, img_id=random.choice(images).id) else: return False
def assign_faces(officer, images): if random.uniform(0, 1) >= 0.5: for num in range(1, len(images)): return models.Face(officer_id=officer.id, img_id=num, original_image_id=random.choice(images).id) else: return False
def assign_faces(officer, images): if random.uniform(0, 1) >= 0.5: img_id = random.choice(images).id return models.Face(officer_id=officer.id, img_id=img_id, original_image_id=img_id, featured=False) else: return False