-
Notifications
You must be signed in to change notification settings - Fork 173
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
image preprocessing #3
Comments
Hi Thanks for the great catching and your detailed post! We have fixed this "double processing" in our latest commit. Briefly speaking, in the file Please feel free to let us know if you have any additional concerns! Best, |
Hi @weijiaheng. I also went over again the CIFAR10 preprocessing cause I thought there was the same double processing issue also there. Line 33 in 100384d
and here docta/docta/core/preprocess.py Line 129 in 100384d
Thank you once again for your help. |
Yes, the CIFAR data is not double-processed. The transforms in the CIFAR dataloader are left for future extensions. Thank you for the good catching. |
Thank you for the clarification @zwzhu-d and @weijiaheng. |
Hi.
Thank you for this interesting package.
I was looking at the examples in the
tools
, more precisely atdocta_rare_pattern.py
and using it with the following command:%run ./tools/docta_rare_pattern.py --feature_type 'embedding' --suffix 'c1m_subset'
, following the demo in the notebook docta_rare_pattern_clothes.ipynb.In this case the dataset is created using:
dataset = Customize_Image_Folder(root=cfg.data_root, transform=None)
.Looking at the
Customize_Image_Folder()
, given thattransform =None
the image will be transformed using the following function:and followed up by:
But then in the
docta_rare_pattern.py
file thepre_processor.encode_feature()
is used to get the image embeddings but also customized the data (performs another normalization step before extracting the embeddings) with:dataset_list += [CustomizedDataset(feature=self.dataset.feature, label=self.dataset.label, preprocess=preprocess)]
, where the preprocess function is retrieved fromget_encoder()
:model_embedding, _, preprocess = open_clip.create_model_and_transforms(self.cfg.embedding_model)
The CLIP preprocessing function seems to be this one:
I am wondering why the images are normalized two times: one within the
Customized_Image_Folder()
and a second time with the preprocessing function fromopen_clip
.Are there any steps that I am missing? I cannot fully understand why the double normalization & preprocessing.
Could you please explain why this strategy is used in the method?
I am greatly thankful for any hints and insights that you can provide.
Thank you for your time.
Later edit: I also noticed this in
docta_cifar10.py
where the data is loaded withCifar10_noisy(cfg, train=True)
which has a transform function defined and then thepre_process.encode_feature()
is called which customized the data with another preprocessing step.I apologize for the long post.
The text was updated successfully, but these errors were encountered: