NVIDIA / pix2pixHD

Synthesizing and manipulating 2048x1024 images with conditional GANs
https://tcwang0509.github.io/pix2pixHD/
Other
6.67k stars 1.39k forks source link

Instance id image and labels image color scale #141

Open benkmoore opened 5 years ago

benkmoore commented 5 years ago

Hi,

I'm trying to apply the trained model (cityscapes) to a semantic layer image from a simulator. What are the color scales/RGB values corresponding to each class? I want to convert semantic layers seen below the first image to the labels image used for testing the second image

frankfurt_000000_003357_gtFine_labelIds_input_label

frankfurt_000000_012868_gtFine_labelIds

Finally, I'd like to create an instance id image (below) from the semantic layer, do you know any good resources/the bet way to go about this?

frankfurt_000001_054640_gtFine_instanceIds

Any help would be great.

Thanks!

(Note, I know the images dont represent the same original image but you get the idea)

benkmoore commented 5 years ago

@rodrigob @mohomran do you know the RGB scale for these images or how they are created from the semantic layer and where I can find more info on this? Thanks

rodrigob commented 5 years ago

I suspect you will find the answers at https://github.com/mcordts/cityscapesScripts/blob/master/cityscapesscripts/helpers/labels.py#L62

benkmoore commented 5 years ago

Thank you!!

benkmoore commented 5 years ago

So I have the label image converted to the correct format however I still cant figure out how to format the instance image. I've used color picker to see whats going on but I can't make sense of it.

Here is a sample of the instance layer I can get, which I now need to format as input for inference. Any ideas on what exactly the format is? I know @tcwang0509 mentioned each eg. car is 26001, 26002 .. but I dont see how this is fed as input into the model or how I produce this format in pixel values

3_1

benkmoore commented 5 years ago

Any ideas @rodrigob @mohomran?

Thanks

rodrigob commented 5 years ago

Sorry, not sure what you are trying to do nor what Pix2Pix wants. Maybe ask the pix2pix authors ?

On Fri, Jul 12, 2019 at 10:23 PM Ben Moore notifications@github.com wrote:

Any ideas @rodrigob https://github.com/rodrigob @mohomran https://github.com/mohomran?

Thanks

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/NVIDIA/pix2pixHD/issues/141?email_source=notifications&email_token=AAAP6V264ZTL4WY4UYJZF3DP7DR5BA5CNFSM4H7AIEFKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZ2ZECA#issuecomment-511021576, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAP6V4YANOAAWURZEOOMDDP7DR5BANCNFSM4H7AIEFA .

benkmoore commented 5 years ago

Hi so I've tried formatting the instance image using the HEX color code system. This produces something like this: where a car is 2600XX, xx being the instance of the car image

However I encounter this error 'RuntimeError: Given groups=1, weight of size 64 36 7 7, expected input[1, 35, 518, 1030] to have 36 channels, but got 35 channels instead '

Any ideas why I'm getting this error? I've tried to follow the formatting guidelines but I must be doing something wrong in the formatting process

Thanks

AndroXD commented 5 years ago

@benkmoore That instance map would never work, if you zoom in you'll notice some anti-aliased/smoothed lines on your car, colors and lines need to be completely solid, here's an example: https://i.imgur.com/o9WtT6J.png You also need to change the color depth to grayscale as you're using RGB now.

Rubiel1 commented 4 years ago

@AndroXD if my input has 3 channels, what is the shape of the instance map? is it supposed to have 3 channels as well?