blue-assistant 4.97.1__tar.gz → 4.104.1__tar.gz
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-4.97.1/blue_assistant.egg-info → blue_assistant-4.104.1}/PKG-INFO +2 -2
- {blue_assistant-4.97.1 → blue_assistant-4.104.1}/README.md +1 -1
- {blue_assistant-4.97.1 → blue_assistant-4.104.1}/blue_assistant/.abcli/tests/script_run.sh +2 -1
- {blue_assistant-4.97.1 → blue_assistant-4.104.1}/blue_assistant/README.py +1 -1
- {blue_assistant-4.97.1 → blue_assistant-4.104.1}/blue_assistant/__init__.py +1 -1
- {blue_assistant-4.97.1 → blue_assistant-4.104.1}/blue_assistant/script/repository/blue_amo/actions/slice_into_frames.py +4 -3
- blue_assistant-4.104.1/blue_assistant/script/repository/blue_amo/actions/stitch_the_frames.py +128 -0
- {blue_assistant-4.97.1 → blue_assistant-4.104.1/blue_assistant.egg-info}/PKG-INFO +2 -2
- blue_assistant-4.97.1/blue_assistant/script/repository/blue_amo/actions/stitch_the_frames.py +0 -81
- {blue_assistant-4.97.1 → blue_assistant-4.104.1}/LICENSE +0 -0
- {blue_assistant-4.97.1 → blue_assistant-4.104.1}/MANIFEST.in +0 -0
- {blue_assistant-4.97.1 → blue_assistant-4.104.1}/blue_assistant/.abcli/abcli.sh +0 -0
- {blue_assistant-4.97.1 → blue_assistant-4.104.1}/blue_assistant/.abcli/actions.sh +0 -0
- {blue_assistant-4.97.1 → blue_assistant-4.104.1}/blue_assistant/.abcli/alias.sh +0 -0
- {blue_assistant-4.97.1 → blue_assistant-4.104.1}/blue_assistant/.abcli/blue_assistant.sh +0 -0
- {blue_assistant-4.97.1 → blue_assistant-4.104.1}/blue_assistant/.abcli/browse.sh +0 -0
- {blue_assistant-4.97.1 → blue_assistant-4.104.1}/blue_assistant/.abcli/script/list.sh +0 -0
- {blue_assistant-4.97.1 → blue_assistant-4.104.1}/blue_assistant/.abcli/script/run.sh +0 -0
- {blue_assistant-4.97.1 → blue_assistant-4.104.1}/blue_assistant/.abcli/script.sh +0 -0
- {blue_assistant-4.97.1 → blue_assistant-4.104.1}/blue_assistant/.abcli/tests/README.sh +0 -0
- {blue_assistant-4.97.1 → blue_assistant-4.104.1}/blue_assistant/.abcli/tests/help.sh +0 -0
- {blue_assistant-4.97.1 → blue_assistant-4.104.1}/blue_assistant/.abcli/tests/script_list.sh +0 -0
- {blue_assistant-4.97.1 → blue_assistant-4.104.1}/blue_assistant/.abcli/tests/version.sh +0 -0
- {blue_assistant-4.97.1 → blue_assistant-4.104.1}/blue_assistant/__main__.py +0 -0
- {blue_assistant-4.97.1 → blue_assistant-4.104.1}/blue_assistant/config.env +0 -0
- {blue_assistant-4.97.1 → blue_assistant-4.104.1}/blue_assistant/env.py +0 -0
- {blue_assistant-4.97.1 → blue_assistant-4.104.1}/blue_assistant/functions.py +0 -0
- {blue_assistant-4.97.1 → blue_assistant-4.104.1}/blue_assistant/help/__init__.py +0 -0
- {blue_assistant-4.97.1 → blue_assistant-4.104.1}/blue_assistant/help/__main__.py +0 -0
- {blue_assistant-4.97.1 → blue_assistant-4.104.1}/blue_assistant/help/functions.py +0 -0
- {blue_assistant-4.97.1 → blue_assistant-4.104.1}/blue_assistant/help/script.py +0 -0
- {blue_assistant-4.97.1 → blue_assistant-4.104.1}/blue_assistant/host.py +0 -0
- {blue_assistant-4.97.1 → blue_assistant-4.104.1}/blue_assistant/logger.py +0 -0
- {blue_assistant-4.97.1 → blue_assistant-4.104.1}/blue_assistant/sample.env +0 -0
- {blue_assistant-4.97.1 → blue_assistant-4.104.1}/blue_assistant/script/__init__.py +0 -0
- {blue_assistant-4.97.1 → blue_assistant-4.104.1}/blue_assistant/script/__main__.py +0 -0
- {blue_assistant-4.97.1 → blue_assistant-4.104.1}/blue_assistant/script/actions/__init__.py +0 -0
- {blue_assistant-4.97.1 → blue_assistant-4.104.1}/blue_assistant/script/actions/functions.py +0 -0
- {blue_assistant-4.97.1 → blue_assistant-4.104.1}/blue_assistant/script/actions/generate_image.py +0 -0
- {blue_assistant-4.97.1 → blue_assistant-4.104.1}/blue_assistant/script/actions/generate_text.py +0 -0
- {blue_assistant-4.97.1 → blue_assistant-4.104.1}/blue_assistant/script/actions/generic.py +0 -0
- {blue_assistant-4.97.1 → blue_assistant-4.104.1}/blue_assistant/script/actions/wip.py +0 -0
- {blue_assistant-4.97.1 → blue_assistant-4.104.1}/blue_assistant/script/load.py +0 -0
- {blue_assistant-4.97.1 → blue_assistant-4.104.1}/blue_assistant/script/repository/__init__.py +0 -0
- {blue_assistant-4.97.1 → blue_assistant-4.104.1}/blue_assistant/script/repository/blue_amo/__init__.py +0 -0
- {blue_assistant-4.97.1 → blue_assistant-4.104.1}/blue_assistant/script/repository/blue_amo/actions/__init__.py +0 -0
- {blue_assistant-4.97.1 → blue_assistant-4.104.1}/blue_assistant/script/repository/blue_amo/classes.py +0 -0
- {blue_assistant-4.97.1 → blue_assistant-4.104.1}/blue_assistant/script/repository/generic/__init__.py +0 -0
- {blue_assistant-4.97.1 → blue_assistant-4.104.1}/blue_assistant/script/repository/generic/classes.py +0 -0
- {blue_assistant-4.97.1 → blue_assistant-4.104.1}/blue_assistant/script/repository/moon_datasets/__init__.py +0 -0
- {blue_assistant-4.97.1 → blue_assistant-4.104.1}/blue_assistant/script/repository/moon_datasets/classes.py +0 -0
- {blue_assistant-4.97.1 → blue_assistant-4.104.1}/blue_assistant/urls.py +0 -0
- {blue_assistant-4.97.1 → blue_assistant-4.104.1}/blue_assistant.egg-info/SOURCES.txt +0 -0
- {blue_assistant-4.97.1 → blue_assistant-4.104.1}/blue_assistant.egg-info/dependency_links.txt +0 -0
- {blue_assistant-4.97.1 → blue_assistant-4.104.1}/blue_assistant.egg-info/requires.txt +0 -0
- {blue_assistant-4.97.1 → blue_assistant-4.104.1}/blue_assistant.egg-info/top_level.txt +0 -0
- {blue_assistant-4.97.1 → blue_assistant-4.104.1}/pyproject.toml +0 -0
- {blue_assistant-4.97.1 → blue_assistant-4.104.1}/requirements.txt +0 -0
- {blue_assistant-4.97.1 → blue_assistant-4.104.1}/setup.cfg +0 -0
- {blue_assistant-4.97.1 → blue_assistant-4.104.1}/setup.py +0 -0
@@ -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).
|
@@ -28,4 +28,4 @@ graph LR
|
|
28
28
|
|
29
29
|
[](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)
|
30
30
|
|
31
|
-
built by 🌀 [`blue_options-4.207.1`](https://github.com/kamangir/awesome-bash-cli), based on 🧠 [`blue_assistant-4.
|
31
|
+
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).
|
@@ -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
|
@@ -0,0 +1,128 @@
|
|
1
|
+
from typing import List
|
2
|
+
import numpy as np
|
3
|
+
import cv2
|
4
|
+
from tqdm import trange
|
5
|
+
import math
|
6
|
+
|
7
|
+
from blueness import module
|
8
|
+
from blue_objects import file, objects
|
9
|
+
from blue_options import string
|
10
|
+
|
11
|
+
from blue_assistant import NAME
|
12
|
+
from blue_assistant.script.repository.base.classes import BaseScript
|
13
|
+
from blue_assistant.logger import logger
|
14
|
+
|
15
|
+
NAME = module.name(__file__, NAME)
|
16
|
+
|
17
|
+
|
18
|
+
def stitch_the_frames(
|
19
|
+
script: BaseScript,
|
20
|
+
node_name: str,
|
21
|
+
) -> bool:
|
22
|
+
list_of_frames_filenames: List[str] = [
|
23
|
+
filename
|
24
|
+
for filename in [
|
25
|
+
script.nodes[node_name_].get("filename", "")
|
26
|
+
for node_name_ in [
|
27
|
+
f"generating-frame-{index+1:03d}"
|
28
|
+
for index in range(script.vars["frame_count"])
|
29
|
+
]
|
30
|
+
]
|
31
|
+
if filename
|
32
|
+
]
|
33
|
+
if not list_of_frames_filenames:
|
34
|
+
return True
|
35
|
+
|
36
|
+
logger.info(
|
37
|
+
"{} frames to stitch: {}".format(
|
38
|
+
len(list_of_frames_filenames),
|
39
|
+
", ".join(list_of_frames_filenames),
|
40
|
+
)
|
41
|
+
)
|
42
|
+
|
43
|
+
list_of_frames: List[np.ndarray] = []
|
44
|
+
for filename in list_of_frames_filenames:
|
45
|
+
success, frame = file.load_image(
|
46
|
+
objects.path_of(
|
47
|
+
filename=filename,
|
48
|
+
object_name=script.object_name,
|
49
|
+
)
|
50
|
+
)
|
51
|
+
|
52
|
+
if success:
|
53
|
+
list_of_frames += [frame]
|
54
|
+
|
55
|
+
if not list_of_frames:
|
56
|
+
return True
|
57
|
+
|
58
|
+
common_height = list_of_frames[0].shape[0]
|
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]
|
63
|
+
|
64
|
+
if frame_height != common_height or frame_width != common_width:
|
65
|
+
list_of_frames[index] = cv2.resize(
|
66
|
+
list_of_frames[index],
|
67
|
+
(common_width, common_height),
|
68
|
+
interpolation=cv2.INTER_AREA,
|
69
|
+
)
|
70
|
+
|
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
|
+
)
|
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).
|
blue_assistant-4.97.1/blue_assistant/script/repository/blue_amo/actions/stitch_the_frames.py
DELETED
@@ -1,81 +0,0 @@
|
|
1
|
-
from typing import List
|
2
|
-
import numpy as np
|
3
|
-
import cv2
|
4
|
-
from tqdm import trange
|
5
|
-
|
6
|
-
from blueness import module
|
7
|
-
from blue_objects import file, objects
|
8
|
-
from blue_options import string
|
9
|
-
|
10
|
-
from blue_assistant import NAME
|
11
|
-
from blue_assistant.script.repository.base.classes import BaseScript
|
12
|
-
from blue_assistant.logger import logger
|
13
|
-
|
14
|
-
NAME = module.name(__file__, NAME)
|
15
|
-
|
16
|
-
|
17
|
-
def stitch_the_frames(
|
18
|
-
script: BaseScript,
|
19
|
-
node_name: str,
|
20
|
-
) -> bool:
|
21
|
-
list_of_frames_filenames: List[str] = [
|
22
|
-
filename
|
23
|
-
for filename in [
|
24
|
-
script.nodes[node_name_].get("filename", "")
|
25
|
-
for node_name_ in [
|
26
|
-
f"generating-frame-{index+1:03d}"
|
27
|
-
for index in range(script.vars["frame_count"])
|
28
|
-
]
|
29
|
-
]
|
30
|
-
if filename
|
31
|
-
]
|
32
|
-
if not list_of_frames_filenames:
|
33
|
-
return True
|
34
|
-
|
35
|
-
logger.info(
|
36
|
-
"{} frames to stitch: {}".format(
|
37
|
-
len(list_of_frames_filenames),
|
38
|
-
", ".join(list_of_frames_filenames),
|
39
|
-
)
|
40
|
-
)
|
41
|
-
|
42
|
-
list_of_frames: List[np.ndarray] = []
|
43
|
-
for filename in list_of_frames_filenames:
|
44
|
-
success, frame = file.load_image(
|
45
|
-
objects.path_of(
|
46
|
-
filename=filename,
|
47
|
-
object_name=script.object_name,
|
48
|
-
)
|
49
|
-
)
|
50
|
-
|
51
|
-
if success:
|
52
|
-
list_of_frames += [frame]
|
53
|
-
|
54
|
-
if not list_of_frames:
|
55
|
-
return True
|
56
|
-
|
57
|
-
common_height = list_of_frames[0].shape[0]
|
58
|
-
for index in trange(len(list_of_frames)):
|
59
|
-
if list_of_frames[index].shape[0] != common_height:
|
60
|
-
aspect_ratio = (
|
61
|
-
list_of_frames[index].shape[1] / list_of_frames[index].shape[0]
|
62
|
-
)
|
63
|
-
new_width = int(common_height * aspect_ratio)
|
64
|
-
|
65
|
-
list_of_frames[index] = cv2.resize(
|
66
|
-
list_of_frames[index],
|
67
|
-
(new_width, common_height),
|
68
|
-
interpolation=cv2.INTER_AREA,
|
69
|
-
)
|
70
|
-
|
71
|
-
full_frame = np.concatenate(list_of_frames, axis=1)
|
72
|
-
logger.info(f"full_frame: {string.pretty_shape_of_matrix(full_frame)}")
|
73
|
-
|
74
|
-
return file.save_image(
|
75
|
-
objects.path_of(
|
76
|
-
filename=f"{node_name}.png",
|
77
|
-
object_name=script.object_name,
|
78
|
-
),
|
79
|
-
full_frame,
|
80
|
-
log=True,
|
81
|
-
)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{blue_assistant-4.97.1 → blue_assistant-4.104.1}/blue_assistant/script/actions/generate_image.py
RENAMED
File without changes
|
{blue_assistant-4.97.1 → blue_assistant-4.104.1}/blue_assistant/script/actions/generate_text.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{blue_assistant-4.97.1 → blue_assistant-4.104.1}/blue_assistant/script/repository/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{blue_assistant-4.97.1 → blue_assistant-4.104.1}/blue_assistant/script/repository/generic/classes.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{blue_assistant-4.97.1 → blue_assistant-4.104.1}/blue_assistant.egg-info/dependency_links.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|