blue-assistant 4.97.1__py3-none-any.whl → 4.104.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- blue_assistant/.abcli/tests/script_run.sh +2 -1
- blue_assistant/README.py +1 -1
- blue_assistant/__init__.py +1 -1
- blue_assistant/script/repository/blue_amo/actions/slice_into_frames.py +4 -3
- blue_assistant/script/repository/blue_amo/actions/stitch_the_frames.py +64 -17
- {blue_assistant-4.97.1.dist-info → blue_assistant-4.104.1.dist-info}/METADATA +2 -2
- {blue_assistant-4.97.1.dist-info → blue_assistant-4.104.1.dist-info}/RECORD +10 -10
- {blue_assistant-4.97.1.dist-info → blue_assistant-4.104.1.dist-info}/LICENSE +0 -0
- {blue_assistant-4.97.1.dist-info → blue_assistant-4.104.1.dist-info}/WHEEL +0 -0
- {blue_assistant-4.97.1.dist-info → blue_assistant-4.104.1.dist-info}/top_level.txt +0 -0
blue_assistant/README.py
CHANGED
blue_assistant/__init__.py
CHANGED
@@ -27,9 +27,10 @@ def slice_into_frames(
|
|
27
27
|
for index in range(script.vars["frame_count"]):
|
28
28
|
node_name = f"generating-frame-{index+1:03d}"
|
29
29
|
|
30
|
-
script.nodes[node_name]["prompt"] =
|
31
|
-
"
|
32
|
-
|
30
|
+
script.nodes[node_name]["prompt"] = (
|
31
|
+
script.nodes[node_name]["prompt"]
|
32
|
+
.replace(":::story", script.nodes["generating-the-story"]["output"])
|
33
|
+
.replace(":::input", list_of_frame_prompts[index])
|
33
34
|
)
|
34
35
|
|
35
36
|
return True
|
@@ -2,6 +2,7 @@ from typing import List
|
|
2
2
|
import numpy as np
|
3
3
|
import cv2
|
4
4
|
from tqdm import trange
|
5
|
+
import math
|
5
6
|
|
6
7
|
from blueness import module
|
7
8
|
from blue_objects import file, objects
|
@@ -55,27 +56,73 @@ def stitch_the_frames(
|
|
55
56
|
return True
|
56
57
|
|
57
58
|
common_height = list_of_frames[0].shape[0]
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
)
|
63
|
-
new_width = int(common_height * aspect_ratio)
|
59
|
+
common_width = list_of_frames[0].shape[1]
|
60
|
+
for index in trange(1, len(list_of_frames)):
|
61
|
+
frame_height = list_of_frames[index].shape[0]
|
62
|
+
frame_width = list_of_frames[index].shape[1]
|
64
63
|
|
64
|
+
if frame_height != common_height or frame_width != common_width:
|
65
65
|
list_of_frames[index] = cv2.resize(
|
66
66
|
list_of_frames[index],
|
67
|
-
(
|
67
|
+
(common_width, common_height),
|
68
68
|
interpolation=cv2.INTER_AREA,
|
69
69
|
)
|
70
70
|
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
log=True,
|
71
|
+
width_count = int(math.ceil(math.sqrt(len(list_of_frames))))
|
72
|
+
height_count = int(math.ceil(len(list_of_frames) / width_count))
|
73
|
+
logger.info(
|
74
|
+
"{} x {} -> {} x {}".format(
|
75
|
+
len(list_of_frames),
|
76
|
+
string.pretty_shape_of_matrix(list_of_frames[0]),
|
77
|
+
height_count,
|
78
|
+
width_count,
|
79
|
+
)
|
81
80
|
)
|
81
|
+
|
82
|
+
list_of_frames += (height_count * width_count - len(list_of_frames)) * [
|
83
|
+
np.zeros_like(list_of_frames[0])
|
84
|
+
]
|
85
|
+
|
86
|
+
full_frame: np.ndarray = None
|
87
|
+
for height_index in trange(height_count):
|
88
|
+
row = np.concatenate(
|
89
|
+
list_of_frames[
|
90
|
+
height_index * width_count : (height_index + 1) * width_count
|
91
|
+
],
|
92
|
+
axis=1,
|
93
|
+
)
|
94
|
+
|
95
|
+
if not height_index:
|
96
|
+
full_frame = row
|
97
|
+
else:
|
98
|
+
full_frame = np.concatenate([full_frame, row], axis=0)
|
99
|
+
logger.info(f"full frame: {string.pretty_shape_of_matrix(full_frame)}")
|
100
|
+
|
101
|
+
for scale in [1, 2, 4]:
|
102
|
+
scaled_full_frame = (
|
103
|
+
full_frame
|
104
|
+
if scale == 1
|
105
|
+
else cv2.resize(
|
106
|
+
full_frame,
|
107
|
+
(
|
108
|
+
int(full_frame.shape[1] / scale),
|
109
|
+
int(full_frame.shape[0] / scale),
|
110
|
+
),
|
111
|
+
interpolation=cv2.INTER_AREA,
|
112
|
+
)
|
113
|
+
)
|
114
|
+
|
115
|
+
if not file.save_image(
|
116
|
+
objects.path_of(
|
117
|
+
filename="{}{}.png".format(
|
118
|
+
node_name,
|
119
|
+
"" if scale == 1 else f"-{scale}",
|
120
|
+
),
|
121
|
+
object_name=script.object_name,
|
122
|
+
),
|
123
|
+
scaled_full_frame,
|
124
|
+
log=True,
|
125
|
+
):
|
126
|
+
return False
|
127
|
+
|
128
|
+
return True
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: blue_assistant
|
3
|
-
Version: 4.
|
3
|
+
Version: 4.104.1
|
4
4
|
Summary: 🧠 An AI Assistant.
|
5
5
|
Home-page: https://github.com/kamangir/blue-assistant
|
6
6
|
Author: Arash Abadpour (Kamangir)
|
@@ -72,4 +72,4 @@ graph LR
|
|
72
72
|
|
73
73
|
[](https://github.com/kamangir/blue-assistant/actions/workflows/pylint.yml) [](https://github.com/kamangir/blue-assistant/actions/workflows/pytest.yml) [](https://github.com/kamangir/blue-assistant/actions/workflows/bashtest.yml) [](https://pypi.org/project/blue-assistant/) [](https://pypistats.org/packages/blue-assistant)
|
74
74
|
|
75
|
-
built by 🌀 [`blue_options-4.207.1`](https://github.com/kamangir/awesome-bash-cli), based on 🧠 [`blue_assistant-4.
|
75
|
+
built by 🌀 [`blue_options-4.207.1`](https://github.com/kamangir/awesome-bash-cli), based on 🧠 [`blue_assistant-4.104.1`](https://github.com/kamangir/blue-assistant).
|
@@ -1,5 +1,5 @@
|
|
1
|
-
blue_assistant/README.py,sha256=
|
2
|
-
blue_assistant/__init__.py,sha256=
|
1
|
+
blue_assistant/README.py,sha256=wuyPT8Y6xkoyPN96Iptozup2PFRkB3v_rVEW4oeiQck,792
|
2
|
+
blue_assistant/__init__.py,sha256=0n0ztAso_mLbL04NjlhSjpR_nS_yWQBrI43iM6zHUaE,311
|
3
3
|
blue_assistant/__main__.py,sha256=URtal70XZc0--3FDTYWcLtnGOqBYjMX9gt-L1k8hDXI,361
|
4
4
|
blue_assistant/config.env,sha256=gjGYkDkmzpwgy7_J-i9RclTKZsKtaAibn7mavD9l4u8,210
|
5
5
|
blue_assistant/env.py,sha256=h2goHjsspOLjZ44yFHqHLB7wPl_GCodg3D6yfSE5FfM,732
|
@@ -19,7 +19,7 @@ blue_assistant/.abcli/script/run.sh,sha256=kSXmyM9NUj2X2orSGyu5t_P5frG-gyumbRq-x
|
|
19
19
|
blue_assistant/.abcli/tests/README.sh,sha256=Qs0YUxVB1OZZ70Nqw2kT1LKXeUnC5-XfQRMfqb8Cbwg,152
|
20
20
|
blue_assistant/.abcli/tests/help.sh,sha256=mENB9ZNBEEPmIs9tp8WkQW3dq75_US7EI7_-d4IJQpo,724
|
21
21
|
blue_assistant/.abcli/tests/script_list.sh,sha256=OVOwWO9wR0eeDZTM6uub-eTKbz3eswU3vEUPWXcK-gQ,178
|
22
|
-
blue_assistant/.abcli/tests/script_run.sh,sha256=
|
22
|
+
blue_assistant/.abcli/tests/script_run.sh,sha256=vfmK8sjkMfSQPwCacQppiL6inMbvQP7nci7qLppFSL0,769
|
23
23
|
blue_assistant/.abcli/tests/version.sh,sha256=oR2rvYR8zi-0VDPIdPJsmsmWwYaamT8dmNTqUh3-8Gw,154
|
24
24
|
blue_assistant/help/__init__.py,sha256=ajz1GSNU9xYVrFEDSz6Xwg7amWQ_yvW75tQa1ZvRIWc,3
|
25
25
|
blue_assistant/help/__main__.py,sha256=cVejR7OpoWPg0qLbm-PZf5TuJS27x49jzfiyCLyzEns,241
|
@@ -38,14 +38,14 @@ blue_assistant/script/repository/__init__.py,sha256=WFkbe-6yyljpmeVpXgLhOPt-YRc7
|
|
38
38
|
blue_assistant/script/repository/blue_amo/__init__.py,sha256=WjL9GIlN-DBnbUMJ8O_FxTp0rcVGlsIS3H9YtXEefTk,76
|
39
39
|
blue_assistant/script/repository/blue_amo/classes.py,sha256=SK3kNk14cZ8M7-aU3tQtbrTQLcw-ev_KtNR8J0U7QZY,2382
|
40
40
|
blue_assistant/script/repository/blue_amo/actions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
41
|
-
blue_assistant/script/repository/blue_amo/actions/slice_into_frames.py,sha256=
|
42
|
-
blue_assistant/script/repository/blue_amo/actions/stitch_the_frames.py,sha256=
|
41
|
+
blue_assistant/script/repository/blue_amo/actions/slice_into_frames.py,sha256=nhlF1MEa-MvCxP3EQ-J7CzcZ8-NqV6fux_r-O_D2cc0,1124
|
42
|
+
blue_assistant/script/repository/blue_amo/actions/stitch_the_frames.py,sha256=jGn6SwLdJA98vG7aspI8J3f0_361XVsHm-7T9vTB2tc,3619
|
43
43
|
blue_assistant/script/repository/generic/__init__.py,sha256=kLffGsQMQAFJTw6IZBE5eBxvshP1x9wwHHR4hsDJblo,75
|
44
44
|
blue_assistant/script/repository/generic/classes.py,sha256=7XIbzwMFFLr79NcVHi53uRPznw2wkQIF8UQ1-KAdNAY,2540
|
45
45
|
blue_assistant/script/repository/moon_datasets/__init__.py,sha256=aCtmP2avh3yKAJ668S3GsLR9vbBOm5zt9FSFCqy_tAs,86
|
46
46
|
blue_assistant/script/repository/moon_datasets/classes.py,sha256=68zThDhjF9gGRnsw8EKNLGOMBFbCSljt0jGovuOzCAc,197
|
47
|
-
blue_assistant-4.
|
48
|
-
blue_assistant-4.
|
49
|
-
blue_assistant-4.
|
50
|
-
blue_assistant-4.
|
51
|
-
blue_assistant-4.
|
47
|
+
blue_assistant-4.104.1.dist-info/LICENSE,sha256=ogEPNDSH0_dhiv_lT3ifVIdgIzHAqNA_SemnxUfPBJk,7048
|
48
|
+
blue_assistant-4.104.1.dist-info/METADATA,sha256=h7zZuR9WIKGKNZ1m4WZA2zxrSLUV4HkcezeCLm9ZNms,2627
|
49
|
+
blue_assistant-4.104.1.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
50
|
+
blue_assistant-4.104.1.dist-info/top_level.txt,sha256=ud0BkBbdOVze13bNqHuhZj1rwCztaBtDf5ChEYzASOs,15
|
51
|
+
blue_assistant-4.104.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|