Skip to content
This repository has been archived by the owner on Oct 28, 2023. It is now read-only.

Add sample mask example #86

Closed
Jake-Shadle opened this issue Dec 30, 2019 · 7 comments · Fixed by #107
Closed

Add sample mask example #86

Jake-Shadle opened this issue Dec 30, 2019 · 7 comments · Fixed by #107
Labels
bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request

Comments

@Jake-Shadle
Copy link
Member

Though #85 is a bug in structopt, we should still have at least one example of using sample masks, so that if users copy it and replace eg, the input image paths, they won't get this confusing error message.

@Jake-Shadle Jake-Shadle added documentation Improvements or additions to documentation enhancement New feature or request labels Dec 30, 2019
@Jake-Shadle
Copy link
Member Author

Also need to add a test specifically for sample masks as they don't really have an explicit one at the moment. #85 (comment)

@Jake-Shadle Jake-Shadle added the bug Something isn't working label Dec 31, 2019
@Hugo-Trentesaux
Copy link

I wrote this but it seems not to work (runs forever)

use texture_synthesis as ts;

// painting into the 1.jpg image, with the shape given by 3_inpaint.jpg, using pattern of 2.jpg
fn main() -> Result<(), ts::Error> {
    let texsynth = ts::Session::builder()
        .inpaint_example(
            &"imgs/masks/3_inpaint.jpg",
            ts::Example::builder(&"imgs/1.jpg").set_sample_method(ts::SampleMethod::Ignore),
            ts::Dims::square(400),
        )
        .add_example(ts::Example::builder(&"imgs/2.jpg").set_sample_method(ts::SampleMethod::All))
        .build()?;

    let generated = texsynth.run(None);
    generated.save("out/09.jpg")
}

@Jake-Shadle
Copy link
Member Author

Fixed by #98

@Jake-Shadle
Copy link
Member Author

Oops.

@Jake-Shadle Jake-Shadle reopened this Feb 26, 2020
This was referenced Feb 26, 2020
@Hugo-Trentesaux
Copy link

I think such an example could be added in the README.
I proposed a version here : https://github.com/Hugo-Trentesaux/texture-synthesis#cli-2

@Jake-Shadle
Copy link
Member Author

Looks good, feel free to make a PR. :)

@Hugo-Trentesaux
Copy link

#112

done ;)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants