Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -38,8 +38,8 @@ def generate_image_from_neighbors(base_pixels):
|
|
| 38 |
|
| 39 |
# Vérification pour changer aléatoirement le pixel pour plus d'unicité
|
| 40 |
if random.random() < 0.2: # 20% de chance de changer le pixel
|
| 41 |
-
|
| 42 |
-
new_pixel_color = np.clip(new_pixel_color, 0, 255).astype(np.uint8)
|
| 43 |
|
| 44 |
generated_image[i, j] = new_pixel_color
|
| 45 |
|
|
|
|
| 38 |
|
| 39 |
# Vérification pour changer aléatoirement le pixel pour plus d'unicité
|
| 40 |
if random.random() < 0.2: # 20% de chance de changer le pixel
|
| 41 |
+
additional_variation = np.array([random.randint(-50, 50) for _ in range(3)])
|
| 42 |
+
new_pixel_color = np.clip(new_pixel_color + additional_variation, 0, 255).astype(np.uint8)
|
| 43 |
|
| 44 |
generated_image[i, j] = new_pixel_color
|
| 45 |
|