Skip to content
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

Where in the code is randomized intensities? #19

Open
bansh123 opened this issue Feb 21, 2024 · 2 comments
Open

Where in the code is randomized intensities? #19

bansh123 opened this issue Feb 21, 2024 · 2 comments

Comments

@bansh123
Copy link

I couldn't find it in the code.
It seems like just setting t_0=0.5.

@brandontrabucco
Copy link
Owner

Hello,

The code for randomizing the intensity strength is in two parts:

for (aug, guidance_scale,
strength, mask, inverted) in zip(
aug, guidance_scale,
strength, mask, inverted
)

This first part defines multiple augmentations with different intensities to sample from. The following second part samples one of the intensities:

def forward(self, image: Image.Image, label: int,
metadata: dict) -> Tuple[Image.Image, int]:
idx = np.random.choice(len(self.probs), p=self.probs)
image, label = self.augs[idx](image, label, metadata)
return image, label

By setting multiple values for --strength when calling train_classifier.py, such as as done here:

--guidance-scale 7.5 7.5 7.5 7.5 \
--strength 1.0 0.75 0.5 0.25 \
--mask 0 0 0 0 \
--inverted 0 0 0 0 \
--probs 0.25 0.25 0.25 0.25 \

the intensity will be sampled uniformly from a list given via the command line

@bansh123
Copy link
Author

Thanks!
I have one more question.
Can you provide instruction to obtain tokens from textual inversion for reproducing the results in figure 5? ( Or download link for learned tokens )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants