Comments (1)
Hi there. You can first download this repository and then add your custom dataset class to ddpm_torch/datasets.py
. For example,
@register_dataset
class CustomDataset(tvds.VisionDataset):
"""
My custom dataset
"""
base_folder = "mydata" # subdirectory under data root, e.g. ~/datasets
resolution = (32, 32) # re-scaled image resolution
channels = 3 # RGB by default
transform = transforms.Compose([
transforms.Resize(32, 32),
transforms.ToTensor(),
transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5))
]) # your custom transformations
all_size = 30000 # your dataset size
def __init__(
self,
root,
transform=None
):
super().__init__(root, transform=transform)
self.filename = sorted([
fname
for fname in os.listdir(os.path.join(root, self.base_folder))
if fname.endswith((".png", ".jpg", ".jpeg", ".bmp"))
], key=lambda name: name.rsplit(".", maxsplit=1)[0])
np.random.RandomState(1234).shuffle(self.filename)
def __getitem__(self, index):
im = PIL.Image.open(os.path.join(self.root, self.base_folder, self.filename[index]))
if self.transform is not None:
im = self.transform(im)
return im
def __len__(self):
return len(self.filename)
from ddpm-torch.
Related Issues (16)
- Vector-conditioning using classifier-free guidance HOT 4
- DDIM sampler training parameters HOT 2
- Question about FID calculation HOT 2
- Bug in ddim.py HOT 1
- FID for CIFAR10 checkpoint HOT 2
- FID & Loss diverge on CIFAR10? HOT 2
- what changes would be needed if we want to use our own custom greyscale(channel=1) dataset having size of 256*256. HOT 1
- some checkpoint HOT 2
- Bug in target noise HOT 1
- CIFAR 10 config HOT 1
- Comment in code is wrong. Upsample supports align_corners=True HOT 2
- Meet bugs when adopting the --eval choice for training. HOT 2
- pretrain HOT 1
- Have you tested the FID for CelebaHQ? HOT 2
- Minor bug in Gaussian Diffusion implementation (q_mean_var)? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ddpm-torch.