anordertoreclaim / PixelCNN

PyTorch implementation of gated PixelCNN
54 stars 17 forks source link

The meaning of arg “color-levels”? #14

Open lujiarui-iie opened 1 year ago

lujiarui-iie commented 1 year ago

Hello, could you tell me what the meaning of "color-levels" is?

anordertoreclaim commented 1 year ago

hey, it's how many discrete levels each value of an image channel can take. For instance, for a black-and-white image (i.e. there is only a single channel) and color-levels equal to 2, the image is binary (each pixel value is equal to either one or two). If color-levels is 255 and image is coloured (i.e. there are 3 channels), you get a usual colored image.

lujiarui-iie commented 1 year ago
font{
    line-height: 1.6;
}
ul,ol{
    padding-left: 20px;
    list-style-position: inside;
}

First of all, thank you very much for your patient answer, even though the code has been released for several years.

        I don't know if my understanding is correct: taking a color image as an example, each channel in each position of the image corresponds to 256 probability values, and the index corresponding to the maximum probability value is taken as the result of image generation (or the prediction result during the training stage).

On 6/19/2023 15:46,Mark ***@***.***> wrote: 

hey, it's how many discrete levels each value of an image channel can take. For instance, for a black-and-white image (i.e. there is only a single channel) and color-levels equal to 2, the image is binary (each pixel value is equal to either one or two). If color-levels is 255 and image is coloured (i.e. there are 3 channels), you get a usual colored image.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

anordertoreclaim commented 1 year ago

I don't know if my understanding is correct: taking a color image as an example, each channel in each position of the image corresponds to 256 probability values, and the index corresponding to the maximum probability value is taken as the result of image generation (or the prediction result during the training stage).

yea, you are absolutely right here note that teacher forcing is used during the training

lujiarui-iie commented 1 year ago
        appreciate your reply deeply and good luck for you!

---- Replied Message ----

     From 

        Mark ***@***.***>

     Date 

    6/23/2023 14:01

     To 

        ***@***.***>

     Cc 

        ***@***.***>
        ,

        ***@***.***>

     Subject 

          Re: [anordertoreclaim/PixelCNN] The meaning of arg “color-levels”? (Issue #14)

I don't know if my understanding is correct: taking a color image as an example, each channel in each position of the image corresponds to 256 probability values, and the index corresponding to the maximum probability value is taken as the result of image generation (or the prediction result during the training stage).

yea, you are absolutely right here note that teacher forcing is used during the training

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>