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

It seems that it was not found α parameter in the inference code? #8

Open
Mr-Jin2 opened this issue Dec 18, 2023 · 1 comment
Open

Comments

@Mr-Jin2
Copy link

Mr-Jin2 commented Dec 18, 2023

hi, I'm trying to use bash test.sh to reproduce the results of a paper. But I can't find any declaration about α ,in this function.
https://github.com/siyuhuang/QuantArt/blob/84d3c83032c03053577159f0af6a137c7a6dae3d/taming/models/vqgan_ref.py#L137

 def transfer(self, x, ref, quantize=True):
        with torch.no_grad():  
            quant_x, _, _ = self.encode(x, quantize=True) 
            quant_x = quant_x.detach()
            quant_ref, _, info_ref = self.encode_real(ref, quantize=True)
            indices_ref = info_ref[2]
            quant_ref = quant_ref.detach()
        
        h_x = self.model_x2y(quant_x, quant_ref)
        if not quantize:
            return quant_x, h_x, quant_ref, torch.zeros(1).to(self.device), [0,0,0], indices_ref
        quant_y, diff_x2y, info_y = self.quantize_dec(h_x)
        indices_y = info_y[2]
        return quant_x, quant_y, quant_ref, diff_x2y, indices_y, indices_ref

Any advice is super appreciated.

@Mr-Jin2 Mr-Jin2 changed the title 推理代码中似乎没找到α参数 It seems that it was not found α parameter in the inference code? Dec 19, 2023
@siyuhuang
Copy link
Owner

siyuhuang commented May 24, 2024

We did not provide the α-controlled inference code. You can achieve it in a simple way by interpolating between the quantized and continuous latent representations then decoding it into an image.

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