tensorflow / models

Models and examples built with TensorFlow
Other
76.97k stars 45.79k forks source link

[Deeplab] Wrong output names when using `vis.py` #4442

Closed mgarbade closed 5 years ago

mgarbade commented 6 years ago

When using the option also_save_raw_predictions = True option to output the inferred semantic segmentation maps, the resulting maps have different names than the original images. How can I fix that?

They don't even map linearly to the original image names for some strange reason, so in my case (nyu_depth_v2 dataset) the test image with the original name NYU0001_0000.jpg gets mapped to the name 000326_prediction.png. So I cannot run my own evaluation script on the extracted outputs.

This was the command that I used:

python deeplab/vis.py \
    --logtostderr \
    --vis_split="val" \
    --model_variant="xception_65" \
    --atrous_rates=6 \
    --atrous_rates=12 \
    --atrous_rates=18 \
    --output_stride=16 \
    --decoder_output_stride=4 \
    --vis_crop_size=640 \
    --vis_crop_size=480 \
    --dataset="nyu" \
    --checkpoint_dir=${PATH_TO_CHECKPOINT} \
    --vis_logdir=${PATH_TO_VIS_DIR} \
    --dataset_dir=${PATH_TO_DATASET}
where ${PATH_TO_CHECKPOINT} is the path to the trained checkpoint (i.e., the path to train_logdir), ${PATH_TO_VIS_DIR} is the directory in which evaluation events will be written to, and ${PATH_TO_DATASET} is the directory in which the nyu dataset saved as `tf.record`-files resides. 
tensorflowbutler commented 6 years ago

Thank you for your post. We noticed you have not filled out the following field in the issue template. Could you update them if they are relevant in your case, or leave them as N/A? Thanks. What is the top-level directory of the model you are using Have I written custom code OS Platform and Distribution TensorFlow installed from TensorFlow version Bazel version CUDA/cuDNN version GPU model and memory Exact command to reproduce

mgarbade commented 6 years ago

Sorry I was passing the also_save_raw_predictions option wrongly.

# From tensorflow/models/research/
python deeplab/vis.py \
    --logtostderr \
    --vis_split="val" \
    --model_variant="xception_65" \
    --atrous_rates=6 \
    --atrous_rates=12 \
    --atrous_rates=18 \
    --output_stride=16 \
    --decoder_output_stride=4 \
    --vis_crop_size=481 \
    --vis_crop_size=641 \
    --dataset="nyu" \
    --checkpoint_dir=${PATH_TO_CHECKPOINT} \
    --vis_logdir=${PATH_TO_VIS_DIR} \
    --dataset_dir=${PATH_TO_DATASET} \
    --also_save_raw_predictions=True

Is working!

wt-huang commented 5 years ago

Closing as this is resolved