pub fn run(mut self, progress: Option<Box<dyn GeneratorProgress>>) -> GeneratedImage {
        // random resolve
        // TODO: Instead of consuming the generator, we could instead make the
        // seed and random_resolve parameters, so that you could rerun the
        // generator with the same inputs
        if let Some(count) = self.params.random_resolve {
            let lvl = self.examples[0].pyramid.len();
            let imgs: Vec<image::RgbaImage> = self
                .examples
                .iter()
                .map(|a| a.pyramid[lvl - 1].clone()) //take the blurriest image
                .collect();
            let imgs_ref = imgs.iter().collect::<Vec<_>>();
            self.generator
                .resolve_random_batch(count as usize, &imgs_ref, self.params.seed);
        }

        // run generator
        self.generator.main_resolve_loop(
            &self.params.to_generator_params(),
            &self.examples,
            progress,
            &self.guides,
            &self.sampling_methods,
        );

        GeneratedImage {
            inner: self.generator,
        }
    }
/// Runs the generator and outputs a generated image.
/// Now, only runs Multiresolution Stochastic Texture Synthesis.
/// Might be interesting to include more algorithms in the future.
Runs the generator and outputs a generated image.
Now, only runs Multiresolution Stochastic Texture Synthesis.
Might be interesting to include more algorithms in the future.
Runs the generator and outputs a generated image . Now only runs Multiresolution Stochastic Texture Synthesis . Might be interesting to include more algorithms in the future .
pub fn run(mut self, progress: Option<Box<dyn GeneratorProgress>>) -> GeneratedImage {
        // random resolve
        // TODO: Instead of consuming the generator, we could instead make the
        // seed and random_resolve parameters, so that you could rerun the
        // generator with the same inputs
        if let Some(count) = self.params.random_resolve {
            let lvl = self.examples[0].pyramid.len();
            let imgs: Vec<image::RgbaImage> = self
                .examples
                .iter()
                .map(|a| a.pyramid[lvl - 1].clone()) //take the blurriest image
                .collect();
            let imgs_ref = imgs.iter().collect::<Vec<_>>();
            self.generator
                .resolve_random_batch(count as usize, &imgs_ref, self.params.seed);
        }
        // run generator
        self.generator.main_resolve_loop(
            &self.params.to_generator_params(),
            &self.examples,
            progress,
            &self.guides,
            &self.sampling_methods,
        );
        GeneratedImage {
            inner: self.generator,
        }
    }
pub fn run ( mut self , progress : Option < Box < dyn GeneratorProgress > > ) -> GeneratedImage { // random resolve // TODO: Instead of consuming the generator, we could instead make the // seed and random_resolve parameters, so that you could rerun the // generator with the same inputs if let Some ( count ) = self . params . random_resolve { let lvl = self . examples [ 0 ] . pyramid . len ( ) ; let imgs : Vec < image :: RgbaImage > = self . examples . iter ( ) . map ( | a | a . pyramid [ lvl - 1 ] . clone ( ) ) //take the blurriest image . collect ( ) ; let imgs_ref = imgs . iter ( ) . collect :: < Vec < _ > > ( ) ; self . generator . resolve_random_batch ( count as usize , & imgs_ref , self . params . seed ) ; } // run generator self . generator . main_resolve_loop ( & self . params . to_generator_params ( ) , & self . examples , progress , & self . guides , & self . sampling_methods , ) ; GeneratedImage { inner : self . generator , } }
Runs the generator and outputs a generated image.
Runs the generator and outputs a generated image .
mut self
progress
Option<Box<dyn GeneratorProgress>>
mut self
progress
Option<Box<dyn GeneratorProgress>>