Zhendong-Wang / Patch-Diffusion

Apache License 2.0
70 stars 13 forks source link

some questions about `random_patch()' #8

Open lyy03 opened 5 months ago

lyy03 commented 5 months ago

Hello, after reading through the entire code file, I noticed that there is a function called random_patch() in the generate.py file for image slicing, but I didn't come across any related calls to this function. I'm unsure where in the code the idea of introducing a conditional scoring function and randomizing image patch sizes at the block level is implemented. I would appreciate it if you could help clarify this confusion when you have time. Thank you very much.

Zhendong-Wang commented 5 months ago

Hi, the code is actually called here https://github.com/Zhendong-Wang/Patch-Diffusion/blob/924f1ed4233e22a5917fc3fded8d65492cfc5c99/training/patch_loss.py#L66.

lyy03 commented 5 months ago

Thank you very much for your prompt answer, maybe I still don't understand that I didn't read all the code, I saw that your readme file only runs dataset_tool, fid, train, and generater files, I don't know if you use the slicing process mentioned in your paper in this process

Zhendong-Wang commented 3 months ago

As I mentioned, during training it is here https://github.com/Zhendong-Wang/Patch-Diffusion/blob/924f1ed4233e22a5917fc3fded8d65492cfc5c99/training/patch_loss.py#L66, during inference, if you want to sample patches only, you can use the random_patch function in the generate.py. By default, the generate.py sample the full image.