junlinhan / yoco Goto Github PK
View Code? Open in Web Editor NEWCode for You Only Cut Once: Boosting Data Augmentation with a Single Cut, ICML 2022.
Code for You Only Cut Once: Boosting Data Augmentation with a Single Cut, ICML 2022.
Dear @JunlinHan
Thank you for your work. I am working on your paper and reproducing the results given in the paper. I have trained a model based on your configuration for cifar-10 but I cannot find an error-rate file. How we can evaluate the top-1 error-rate?
Like this
print('Test\t Prec@1: {top1.avg:.3f} (Err: {error:.3f} )\n'
.format(top1=top1, error=100 - top1.avg))
Dear @JunlinHan
I hope you are doing well. You have mentioned ImageNet classification result (linear protocol, 1% label and 10% label). I have found the main_lincls.py
for linear protocol experiment and main_moco.py
for label experiment. However, I'm not able to find where the 1% and 10% label specifications are mentioned in your code. Could you please guide me on this? A prompt response would greatly assist me in my ongoing work.
Regards,
Khawar
Hi @JunlinHan
I have a dataset contains single image and I am simply applying your YOCO
technique to visualize image generated by YOCO. I just get a single output sometimes the output is same image as input and sometimes flip+cut. Is that correct?
Code
import torch
from torchvision.utils import save_image
import torchvision.transforms as transforms
from torchvision import datasets
from torchvision.transforms import ToTensor
from torch.utils.data import DataLoader
training_data = datasets.ImageFolder(root="/media/cvpr/CM_22/dataset/train", transform=ToTensor())
train_loader = DataLoader(training_data, batch_size=64, shuffle=True)
def YOCO(images, aug, h, w):
images = torch.cat((aug(images[:, :, :, 0:int(w / 2)]), aug(images[:, :, :, int(w / 2):w])), dim=3) if \
torch.rand(1) > 0.5 else torch.cat((aug(images[:, :, 0:int(h / 2), :]), aug(images[:, :, int(h / 2):h, :])),
dim=2)
return images
for i, (images, target) in enumerate(train_loader):
aug = torch.nn.Sequential(
transforms.RandomHorizontalFlip(), )
_, _, h, w = images.shape
# perform augmentations with YOCO
images = YOCO(images, aug, h, w)
save_image(images, 'img' + str(i) + '.png')
很有意思的工作,简单有效!
一个小疑惑,为什么要都是采用相同(same type)的数据增强方法用于两个cuts呢?看了下ablation,似乎是关于位置的和cuts数目的消融实验。
会不会不同的cuts用不同的数据增强更好呢?
比如说:一部分颜色变换,另一部分旋转反转。
Hi, thanks for your inspiring work! I got a question here.
Have you split the training dataset into train and val? From the code you shared, it seems that you directly used the test dataset for validation by which the model with the best performance is picked:
val_loader = torch.utils.data.DataLoader( datasets.CIFAR10('../data', train=False, transform=transform_test), batch_size=args.batch_size, shuffle=True, num_workers=args.workers, pin_memory=True)
I am not sure if it is ok and I am really confused, because I notice some researchers make the split while some others do not.
Dear @JunlinHan
Why do you called "which enjoys the properties of parameter-free".
What do you mean by "parameter-free"?
Dear @JunlinHan,
Did you run all experiments multiple times than average and put them into the table? Like training resnet18 fives times and then averaging the accuracy and putting it into the table. Why I am asking this question because every time when I am training resnet18 I got different accuracy and error rate (almost 1% fluctuation).
Regards,
Khawar
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.