-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
为什么显示无标签的数据集仍要读取标签 #174
Comments
我也遇到了这个问题,看了一下代码,似乎是因为数据增强是统一对原图和标签进行的,为了方便,无标签数据也复用了这套流程。 |
感谢你的来信,请问你是如何解决的呢,我是将提前准备了许多假标签,像素值全是0的,好像也可以重新写有标签和无标签的加载数据dataloader部分
…------------------ 原始邮件 ------------------
发件人: "Haochen-Wang409/U2PL" ***@***.***>;
发送时间: 2024年11月28日(星期四) 上午9:18
***@***.***>;
抄送: "「 ***@***.******@***.***>;
主题: Re: [Haochen-Wang409/U2PL] 为什么显示无标签的数据集仍要读取标签 (Issue #174)
我也遇到了这个问题,看了一下代码,似乎是因为数据增强是统一对原图和标签进行的,为了方便,无标签数据也复用了这套流程。
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
因为标签这一部分最终并不会用到,所以我把原图copy了一份,放入原本应该存放标签的位置。这样做只是为了能够顺利通过代码,但从训练效率上来说,最好还是重写有标签和无标签的数据预处理部分~ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
dset = city_dset(cfg["data_root"], cfg["data_list"], trs_form, seed, n_sup, split)
dset_unsup = city_dset(
cfg["data_root"], data_list_unsup, trs_form_unsup, seed, n_sup, split
)
这两个都是使用的city_dset获取数据信息,而city_dset下面的类中似乎没有对有标签的和无标签的进行区分。
class city_dset(BaseDataset):
def init(self, data_root, data_list, trs_form, seed, n_sup, split="val"):
super(city_dset, self).init(data_list)
self.data_root = data_root
self.transform = trs_form
random.seed(seed)
if len(self.list_sample) >= n_sup and split == "train":
self.list_sample_new = random.sample(self.list_sample, n_sup)
elif len(self.list_sample) < n_sup and split == "train":
num_repeat = math.ceil(n_sup / len(self.list_sample))
self.list_sample = self.list_sample * num_repeat
The text was updated successfully, but these errors were encountered: