lllyasviel / AppearanceEraser

Erasing Appearance Preservation in Optimization-based Smoothing (ECCV 2020)
Apache License 2.0
182 stars 22 forks source link

Unrecognized function or variable 'seg'. #3

Closed bycloudai closed 4 years ago

bycloudai commented 4 years ago

Hi, thank you for your amazing work.

I tried to run this code with this line: matlab ./code/matlab/L1_EAP_auto/run.m

but it gave me this error:

>> run
     1

Construct local sparse matrix...
Construct global sparse matrix...
Unrecognized function or variable 'seg'.

Error in l1flattening (line 45)
splabel = seg(image_lab, 0.5, 5, 500);

Error in run>@(a,b)l1flattening(a,b,struct()) (line 2)
output=eap(img, 0.1, @(a, b)l1flattening(a, b, struct()));

Error in eap (line 10)
    output=func(img, repmat(mask, [1, 1, 3]));

Error in run (line 2)
output=eap(img, 0.1, @(a, b)l1flattening(a, b, struct()));

How can I fix this? Thank you

lllyasviel commented 4 years ago

This is weird, I have never seen this problem. What is your OS and Matlab version?

bycloudai commented 4 years ago

I am on Windows 10, MATLAB r2020a

lllyasviel commented 4 years ago

I am using MATLAB r2016a and it automatically configurated my path.

For MATLAB r2020a, I believe gceboh is correct and you may follow that steps 1&2.

bycloudai commented 4 years ago

I tried to do the following steps that gceboh provided. I am able to run run.m now. Btw how long does it usually run for? I've been running 1 image for 1.5hours and it's still going.

lllyasviel commented 4 years ago

I use I7 CPU. An 512*512 image takes about 7 minutes. The algorithm complexity is O(n^4) and large image is not recommended.

lllyasviel commented 4 years ago

And this is exactly the reason why it is not possible to implement this algorithm in python. Python's sparse optimisation is even weaker than matlab and will take much longer time.