数据没有上传完?

#1
by PANDATREE - opened

Dataset({
features: ['image'],
num_rows: 111649
})
里面只有mask,没看到caption

直接使用的Yuanshi/Subjects200K的caption?

感谢您的关注!
mask.zip 中存放的是对应的 mask, coord.zip 中存放的是对应的 coordinate。
图像数据和 caption 直接使用 Yuanshi/Subjects200K 即可。

请问subject200K里的数据如何和mask里的图片对应上?我看mask里的图片命名很随意,哪里有相关的subject200k里的图片和mask对应的文件嘛?

This comment has been hidden (marked as Resolved)

请问subject200K里的数据如何和mask里的图片对应上?我看mask里的图片命名很随意,哪里有相关的subject200k里的图片和mask对应的文件嘛?

https://github.com/bytedance-fanqie-ai/MOSAIC/blob/main/my_datasets/Subject200k_dataset.py

这里可以直接找到对应哈

请问subject200K里的数据如何和mask里的图片对应上?我看mask里的图片命名很随意,哪里有相关的subject200k里的图片和mask对应的文件嘛?

https://github.com/bytedance-fanqie-ai/MOSAIC/blob/main/my_datasets/Subject200k_dataset.py

这里可以直接找到对应哈

您好,感谢您的分享,我保持这个giuhub的掩码uid的逻辑不变,但是计算出的uid在mask文件夹中不存在。
这是部分代码:
def get_image_hash(image: Image.Image) -> str:
"""计算图像像素 Hash"""
with BytesIO() as buffer:
image.save(buffer, format="PNG")
img_bytes = buffer.getvalue()
return hashlib.sha256(img_bytes).hexdigest()[:8]

description = example['description']
item_name = description['item']
tgt_caption = description['description_0']

图像读取

image = example['image']
if image is None:
return None

if not isinstance(image, Image.Image):
image = Image.open(image).convert("RGB")

1. 图像分割逻辑

padding, img_size_orig = 8, 512

TGT 在左,REF 在右

tgt_img_pil = image.crop((padding, padding, img_size_orig + padding, img_size_orig + padding))
ref_img_pil = image.crop(
(img_size_orig + padding * 2, padding, img_size_orig * 2 + padding * 2, padding + img_size_orig))

2. UID 生成

img_hash = get_image_hash(tgt_img_pil)
key = f"{item_name}{tgt_caption}{img_hash}"
uid = hashlib.sha256(key.encode("utf-8")).hexdigest()
能请您帮我看看是怎么回事吗?非常感谢

您好,感谢您的分享,我保持这个giuhub的掩码uid的逻辑不变,但是计算出的uid在mask文件夹中不存在。
能请您帮我看看是怎么回事吗?非常感谢

https://github.com/bytedance-fanqie-ai/MOSAIC/blob/main/my_datasets/Subject200k_dataset.py

Dataset 最下面有主函数的部分,我这边直接运行/debug Subject200k_dataset.py 是可以找到对应的,你可以先直接 debug 一下试试。

您好,感谢您的分享,我保持这个giuhub的掩码uid的逻辑不变,但是计算出的uid在mask文件夹中不存在。
能请您帮我看看是怎么回事吗?非常感谢

https://github.com/bytedance-fanqie-ai/MOSAIC/blob/main/my_datasets/Subject200k_dataset.py

Dataset 最下面有主函数的部分,我这边直接运行/debug Subject200k_dataset.py 是可以找到对应的,你可以先直接 debug 一下试试。

好的

Sign up or log in to comment