Cursor Agent
commited on
Commit
·
3e01d82
1
Parent(s):
3fb53a0
Enhance ball rings with neon glow effect (additive blending)
Browse files
app.py
CHANGED
|
@@ -862,7 +862,7 @@ SPEED_COLOR_STOPS = [
|
|
| 862 |
]
|
| 863 |
SPEED_COLOR_ABOVE_MAX = (255 / 255.0, 162 / 255.0, 0 / 255.0) # Neon Orange
|
| 864 |
RING_RADIUS_CLAMP_RATIO = 0.2 # ±20%
|
| 865 |
-
RING_SIZE_SCALE_DEFAULT =
|
| 866 |
|
| 867 |
|
| 868 |
def _maybe_upscale_for_display(image: Image.Image) -> Image.Image:
|
|
@@ -1290,7 +1290,10 @@ def _build_ball_ring_mask(
|
|
| 1290 |
else:
|
| 1291 |
return None
|
| 1292 |
|
| 1293 |
-
|
|
|
|
|
|
|
|
|
|
| 1294 |
|
| 1295 |
# Determine end frame based on duration limit
|
| 1296 |
duration = getattr(state, "fx_ring_duration", 16)
|
|
@@ -3097,7 +3100,7 @@ with gr.Blocks(title="SAM2 Video (Transformers) - Interactive Segmentation", the
|
|
| 3097 |
minimum=10,
|
| 3098 |
maximum=200,
|
| 3099 |
step=5,
|
| 3100 |
-
value=
|
| 3101 |
info="Adjust overall ring size relative to detected ball radius."
|
| 3102 |
)
|
| 3103 |
|
|
|
|
| 862 |
]
|
| 863 |
SPEED_COLOR_ABOVE_MAX = (255 / 255.0, 162 / 255.0, 0 / 255.0) # Neon Orange
|
| 864 |
RING_RADIUS_CLAMP_RATIO = 0.2 # ±20%
|
| 865 |
+
RING_SIZE_SCALE_DEFAULT = 125.0 # percent
|
| 866 |
|
| 867 |
|
| 868 |
def _maybe_upscale_for_display(image: Image.Image) -> Image.Image:
|
|
|
|
| 1290 |
else:
|
| 1291 |
return None
|
| 1292 |
|
| 1293 |
+
if int(frame_idx) <= int(kick_candidate):
|
| 1294 |
+
start_idx = int(kick_candidate) + 1
|
| 1295 |
+
else:
|
| 1296 |
+
start_idx = max(int(kick_candidate) + 1, int(frame_idx))
|
| 1297 |
|
| 1298 |
# Determine end frame based on duration limit
|
| 1299 |
duration = getattr(state, "fx_ring_duration", 16)
|
|
|
|
| 3100 |
minimum=10,
|
| 3101 |
maximum=200,
|
| 3102 |
step=5,
|
| 3103 |
+
value=125,
|
| 3104 |
info="Adjust overall ring size relative to detected ball radius."
|
| 3105 |
)
|
| 3106 |
|