Code Monkey home page Code Monkey logo

patch-based-texture-synthesis's People

Contributors

anopara avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

patch-based-texture-synthesis's Issues

Add a requirements.txt?

More of a comment than a real issue. But would it be possible to include a requirement.txt so that users can jump into using this package with less keystrokes?

OOM errors with large example maps

Hi,

is there a hard limit to the size of the example image?

Consistently getting Out of memory errors with example images larger than around 300 pixels when testing on google colab

Any help would be appreciated :)

Also getting the following error, not sure if it's the cause of the crash or an effect of it:

`modified output size: (2050, 2050, 3)
number of patches: 34

/content/patch-based-texture-synthesis/patchBasedTextureSynthesis.py:237: RuntimeWarning: invalid value encountered in true_divide
probabilities /= np.sum(probabilities) #normalize so they add up to one


ValueError Traceback (most recent call last)

in ()
6
7 pbts = patchBasedTextureSynthesis(exampleMapPath, outputPath, outputSize, patchSize, overlapSize, in_windowStep = 5, in_mirror_hor = True, in_mirror_vert = True, in_shapshots = True)
----> 8 pbts.resolveAll()

1 frames

/content/patch-based-texture-synthesis/patchBasedTextureSynthesis.py in resolveNext(self)
79 #choose random valid patch
80 probabilities = self.distances2probability(dist, self.PARM_truncation, self.PARM_attenuation)
---> 81 chosenPatchId = np.random.choice(ind, 1, p=probabilities)
82
83 #update canvas

mtrand.pyx in numpy.random.mtrand.RandomState.choice()

ValueError: probabilities contain NaN`

Thanks for sharing !

Thanks for sharing the patch based version. I will totally include it in my current workflow.

There is a random crash: ValueError: zero-size array to reduction operation maximum which has no identity

Below is the full log:

ValueError
8 pbts = patchBasedTextureSynthesis(exampleMapPath, outputPath, outputSize, patchSize, overlapSize, in_windowStep = 5, in_mirror_hor = True, in_mirror_vert = True, in_shapshots = True)
----> 9 pbts.resolveAll()

F:\ZheChen\GitHubCode\patch-based-texture-synthesis\patchBasedTextureSynthesis.py in resolveAll(self)
46 #resolve all unresolved patches
47 for i in range(np.sum(1-self.filledMap).astype(int)):
---> 48 self.resolveNext()
49
50 if not self.snapshots:

F:\ZheChen\GitHubCode\patch-based-texture-synthesis\patchBasedTextureSynthesis.py in resolveNext(self)
75
76 #choose random valid patch
---> 77 probabilities = self.distances2probability(dist, self.PARM_truncation, self.PARM_attenuation)
78 chosenPatchId = np.random.choice(ind, 1, p=probabilities)
79

F:\ZheChen\GitHubCode\patch-based-texture-synthesis\patchBasedTextureSynthesis.py in distances2probability(self, distances, PARM_truncation, PARM_attenuation)
222 def distances2probability(self, distances, PARM_truncation, PARM_attenuation):
223
--> 224 probabilities = 1 - distances / np.max(distances)
225 probabilities *= (probabilities > PARM_truncation)
226 probabilities = pow(probabilities, PARM_attenuation) #attenuate the values

E:\anaconda3\envs\ts\lib\site-packages\numpy\core\fromnumeric.py in amax(a, axis, out, keepdims, initial)
2332 """
2333 return _wrapreduction(a, np.maximum, 'max', axis, None, out, keepdims=keepdims,
-> 2334 initial=initial)
2335
2336

E:\anaconda3\envs\ts\lib\site-packages\numpy\core\fromnumeric.py in _wrapreduction(obj, ufunc, method, axis, dtype, out, **kwargs)
81 return reduction(axis=axis, out=out, **passkwargs)
82
---> 83 return ufunc.reduce(obj, axis, dtype, out, **passkwargs)
84
85

ValueError: zero-size array to reduction operation maximum which has no identity

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.