VITON icon indicating copy to clipboard operation
VITON copied to clipboard

Stage 2 Output images are all black

Open Neuroforge opened this issue 6 years ago • 23 comments

Hello,

I am running this code.

Stage 1 works fine.

Stage 2 runs but outputs black images. I am using Octave and not Matlab to run shape_context_warp.m. Is the output of this available online?

Regards,

Daniel

Neuroforge avatar May 10 '18 01:05 Neuroforge

yes, i'm in exactly the same situation as you; i think it doesn't work with octave ...

silky avatar May 10 '18 01:05 silky

Are all the images black?

SheikArbaz avatar May 11 '18 05:05 SheikArbaz

yep; all of them in the stage2 html file

silky avatar May 11 '18 05:05 silky

screen shot 2018-05-11 at 6 25 29 pm

All of the images are black.

Neuroforge avatar May 11 '18 06:05 Neuroforge

It means TPS points are not extracted. Run extract_tps.m in matlab.

SheikArbaz avatar May 11 '18 10:05 SheikArbaz

if i run extract_tps from the ./prepare_data/` folder, i get

error: save: unable to open output file '../data/tps/000003_0.mat'

and indeed; in the data folder of the root dit, there is no tps folder ... ?

am i missing something?

-- edit: i think the problem is that it needs to point to ./results/stage1/tps instead; so i've symlinked it. it's running now, but i think it's going to take a few hours at least.

silky avatar May 11 '18 11:05 silky

You are missing tps data..... download from google drive mentioned in the ReadMe of the project.

ghost avatar May 11 '18 12:05 ghost

@arbaz-j-7 that's mentioned in the readme for training, not for testing, which is what i'm trying to do. is it still necessary? because i just did it, and it doesn't seem to have worked...

silky avatar May 11 '18 12:05 silky

I think, TPS of the test images is also required as an input to the network.

ghost avatar May 11 '18 12:05 ghost

Could someone help turn the Matlab tps parser into Python?

Neuroforge avatar May 18 '18 02:05 Neuroforge

Even I am facing the same issue, all the images are black. Anybody found a solution?

perseus784 avatar May 21 '18 09:05 perseus784

Sorry that there are some hardcoded paths in https://github.com/xthan/VITON/blob/master/model_zalando_refine_test.py

If you are getting blank images, probably the tps results (.mat files) are not available.

xthan avatar May 21 '18 14:05 xthan

The problem is the not everyone has Matlab, we used the Open Source program Octave.

Octave != Matlab = Black Images.

Can the Matlab scripts be converted to Python?

Neuroforge avatar May 21 '18 22:05 Neuroforge

@Neuroforge Is model_zolando_refine_test.py calling .m files internally?

perseus784 avatar May 22 '18 05:05 perseus784

Nope. It has to be called between stage 1 and stage 2 in order to parse the new tps points.

Neuroforge avatar May 22 '18 08:05 Neuroforge

Exactly which matlab file should be run between both stages?...and Is there any other steps that should be run beforerunning test_stage2.sh?

perseus784 avatar May 22 '18 09:05 perseus784

In the instructions of the Readme the second stage requires a Matlab script to be called.

Second stage

Run the matlab script shape_context_warp.m to extract the TPS transformation control points.

When run with Octave, as Matlab is expensive, it produces the error output.

Neuroforge avatar May 22 '18 09:05 Neuroforge

Also in training new data Matlab is also required.....

First run extract_tps.m. This will take sometime, you can try run it in parallel or directly download the pre-computed TPS control points via Google Drive and put them in data/tps/.

Neuroforge avatar May 22 '18 09:05 Neuroforge

I found a solution for running shape_context_warp.m with Octave: simply change L57 in shape_context_warp.m from save([MASK_DIR, image_name1, '_', image_name2, '_tps.mat'], 'control_points'); to save([MASK_DIR, image_name1, '_', image_name2, '_tps.mat'], 'control_points', '-v6');.

This saves the file in a format that python can open when using Octave.

I have submitted a PR to implement this quick fix.

RohanBhandari avatar Jun 13 '18 20:06 RohanBhandari

@RohanBhandari Does this fix work for testing or training, or both?

I'm still getting black output image from stage2, even with this change. Any other advice?

The original tps files are 197Kb but after this fix they are only 2kb.

Neuroforge avatar Jun 13 '18 20:06 Neuroforge

I have only used it for testing. I think there may be other places where a similar fix is needed for training.

If it's still not working for testing, double-check that you have the "image" package installed for Octave and load it by adding the line pkg load image; to the beginning of the shape_context_warp.m script.

If that still doesn't work, I would remove the "try" statement from this block, as it suppresses the error output when the function fails. Then you can debug based on the error message.

RohanBhandari avatar Jun 17 '18 00:06 RohanBhandari

@Neuroforge did it work with octave for you ?

royaljain avatar Jan 08 '19 13:01 royaljain

Has anyone managed to train the network with another dataset?

berkkara34 avatar May 27 '19 15:05 berkkara34