Spaces:
Sleeping
Sleeping
add output text
Browse files- app.py +9 -1
- requirements.txt +1 -1
app.py
CHANGED
|
@@ -45,6 +45,9 @@ def move_circle(img: np.ndarray, x: int = 100, y: int = 100) -> np.ndarray:
|
|
| 45 |
cv2.circle(out, (x, y), 10, (255, 0, 0), -1)
|
| 46 |
return out
|
| 47 |
|
|
|
|
|
|
|
|
|
|
| 48 |
# Pipeline definition
|
| 49 |
# -------------------
|
| 50 |
|
|
@@ -54,7 +57,8 @@ def pipe(inp: np.ndarray) -> Tuple[np.ndarray, np.ndarray]:
|
|
| 54 |
out = processing_block(out)
|
| 55 |
out = draw_text(out)
|
| 56 |
out = move_circle(out)
|
| 57 |
-
|
|
|
|
| 58 |
|
| 59 |
# Add interactivity to the processing blocks
|
| 60 |
# ------------------------------------------
|
|
@@ -83,6 +87,10 @@ def add_controls() -> None:
|
|
| 83 |
amplify=(0.5, [0., 1.], "Amplify")
|
| 84 |
)(processing_block)
|
| 85 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 86 |
# Add interactivity to the processing blocks
|
| 87 |
# ------------------------------------------
|
| 88 |
|
|
|
|
| 45 |
cv2.circle(out, (x, y), 10, (255, 0, 0), -1)
|
| 46 |
return out
|
| 47 |
|
| 48 |
+
|
| 49 |
+
def remove_caps(txt_in: str = "TUTU") -> str:
|
| 50 |
+
return txt_in.lower()
|
| 51 |
# Pipeline definition
|
| 52 |
# -------------------
|
| 53 |
|
|
|
|
| 57 |
out = processing_block(out)
|
| 58 |
out = draw_text(out)
|
| 59 |
out = move_circle(out)
|
| 60 |
+
txt_out = remove_caps()
|
| 61 |
+
return inp, out, txt_out
|
| 62 |
|
| 63 |
# Add interactivity to the processing blocks
|
| 64 |
# ------------------------------------------
|
|
|
|
| 87 |
amplify=(0.5, [0., 1.], "Amplify")
|
| 88 |
)(processing_block)
|
| 89 |
|
| 90 |
+
interactive(
|
| 91 |
+
txt_in=TextPrompt("OUT TEXT",
|
| 92 |
+
name="Out text no caps")
|
| 93 |
+
)(remove_caps)
|
| 94 |
# Add interactivity to the processing blocks
|
| 95 |
# ------------------------------------------
|
| 96 |
|
requirements.txt
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
interactive-pipe>=0.8.
|
|
|
|
| 1 |
+
interactive-pipe>=0.8.5
|