Commit
·
288fa8b
1
Parent(s):
e8a13e5
add some drama
Browse files
app.py
CHANGED
|
@@ -6,7 +6,7 @@ os.environ["SPACES_DISABLE_RELOAD"] = "1"
|
|
| 6 |
|
| 7 |
from utils.presets import EMOTION_PRESETS
|
| 8 |
from utils.drama import apply_drama
|
| 9 |
-
from utils.color_model import infer_color,
|
| 10 |
from utils.visualization import generate_scatter
|
| 11 |
|
| 12 |
|
|
@@ -18,9 +18,14 @@ def process_emotion(emotion, drama):
|
|
| 18 |
|
| 19 |
cinematic = apply_drama(raw, target, drama)
|
| 20 |
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
|
| 25 |
scatter_fig = generate_scatter(raw, cinematic, emotion, drama)
|
| 26 |
|
|
@@ -28,7 +33,7 @@ def process_emotion(emotion, drama):
|
|
| 28 |
preset["text"],
|
| 29 |
raw,
|
| 30 |
cinematic,
|
| 31 |
-
|
| 32 |
color_block,
|
| 33 |
scatter_fig
|
| 34 |
)
|
|
|
|
| 6 |
|
| 7 |
from utils.presets import EMOTION_PRESETS
|
| 8 |
from utils.drama import apply_drama
|
| 9 |
+
from utils.color_model import infer_color, apply_cinematic_blend, render_color
|
| 10 |
from utils.visualization import generate_scatter
|
| 11 |
|
| 12 |
|
|
|
|
| 18 |
|
| 19 |
cinematic = apply_drama(raw, target, drama)
|
| 20 |
|
| 21 |
+
# 1️⃣ Get cinematic parameters from model
|
| 22 |
+
model_output = infer_color(cinematic)
|
| 23 |
+
|
| 24 |
+
# 2️⃣ Apply drama-aware blend toward white
|
| 25 |
+
blended = apply_cinematic_blend(model_output, drama)
|
| 26 |
+
|
| 27 |
+
# 3️⃣ Render HTML
|
| 28 |
+
color_block = render_color(blended)
|
| 29 |
|
| 30 |
scatter_fig = generate_scatter(raw, cinematic, emotion, drama)
|
| 31 |
|
|
|
|
| 33 |
preset["text"],
|
| 34 |
raw,
|
| 35 |
cinematic,
|
| 36 |
+
blended,
|
| 37 |
color_block,
|
| 38 |
scatter_fig
|
| 39 |
)
|