Spaces:
Sleeping
Sleeping
Manish Gupta commited on
Commit ·
323c22b
1
Parent(s): 66c6d87
Path changes.
Browse files
.DS_Store
ADDED
|
Binary file (6.15 kB). View file
|
|
|
app.py
CHANGED
|
@@ -32,7 +32,7 @@ def load_data(comic_id: str, character_data: list, current_index: int):
|
|
| 32 |
images = []
|
| 33 |
name = character_data[current_index]["name"]
|
| 34 |
for idx in range(1, 5):
|
| 35 |
-
url = f"s3://{AWS_BUCKET}/{comic_id}/
|
| 36 |
data = aws_utils.fetch_from_s3(url)
|
| 37 |
images.append(Image.open(io.BytesIO(data)))
|
| 38 |
|
|
@@ -46,7 +46,7 @@ def load_data_once(comic_id: str, current_index: int):
|
|
| 46 |
characters = []
|
| 47 |
data = eval(
|
| 48 |
aws_utils.fetch_from_s3(
|
| 49 |
-
source=f"s3://{AWS_BUCKET}/{comic_id}/characters.json"
|
| 50 |
).decode("utf-8")
|
| 51 |
)
|
| 52 |
for _, profile in data.items():
|
|
@@ -56,7 +56,7 @@ def load_data_once(comic_id: str, current_index: int):
|
|
| 56 |
# Loading the 0th frame of 0th scene in 0th episode.
|
| 57 |
name = characters[current_index]["name"]
|
| 58 |
for idx in range(1, 5):
|
| 59 |
-
url = f"s3://{AWS_BUCKET}/{comic_id}/
|
| 60 |
data = aws_utils.fetch_from_s3(url)
|
| 61 |
images.append(Image.open(io.BytesIO(data)))
|
| 62 |
|
|
@@ -80,7 +80,7 @@ def save_image(
|
|
| 80 |
|
| 81 |
aws_utils.save_to_s3(
|
| 82 |
AWS_BUCKET,
|
| 83 |
-
f"{comic_id}/characters",
|
| 84 |
img_bytes,
|
| 85 |
f"{name}.jpg",
|
| 86 |
)
|
|
|
|
| 32 |
images = []
|
| 33 |
name = character_data[current_index]["name"]
|
| 34 |
for idx in range(1, 5):
|
| 35 |
+
url = f"s3://{AWS_BUCKET}/{comic_id}/characters/compositions/{name}/{idx}.jpg"
|
| 36 |
data = aws_utils.fetch_from_s3(url)
|
| 37 |
images.append(Image.open(io.BytesIO(data)))
|
| 38 |
|
|
|
|
| 46 |
characters = []
|
| 47 |
data = eval(
|
| 48 |
aws_utils.fetch_from_s3(
|
| 49 |
+
source=f"s3://{AWS_BUCKET}/{comic_id}/characters/characters.json"
|
| 50 |
).decode("utf-8")
|
| 51 |
)
|
| 52 |
for _, profile in data.items():
|
|
|
|
| 56 |
# Loading the 0th frame of 0th scene in 0th episode.
|
| 57 |
name = characters[current_index]["name"]
|
| 58 |
for idx in range(1, 5):
|
| 59 |
+
url = f"s3://{AWS_BUCKET}/{comic_id}/characters/compositions/{name}/{idx}.jpg"
|
| 60 |
data = aws_utils.fetch_from_s3(url)
|
| 61 |
images.append(Image.open(io.BytesIO(data)))
|
| 62 |
|
|
|
|
| 80 |
|
| 81 |
aws_utils.save_to_s3(
|
| 82 |
AWS_BUCKET,
|
| 83 |
+
f"{comic_id}/characters/images",
|
| 84 |
img_bytes,
|
| 85 |
f"{name}.jpg",
|
| 86 |
)
|