|
|
On 27/01/2019 06:43, BayashiPascal wrote:
> Hi everyone,
>
> I came up a few days ago with some (maybe?) unconventional way to use POV-Ray
> for my job and would like to introduce it here in case it would be of any
> interest to someone else.
> I was looking for data sets of images to test machine learning algorithms and
> couldn't find any one that fit my needs. Then I started thinking of how I could
> generate automatically my own data sets. Of course, speaking of synthesis
> picture, I immediately thought of POV-Ray, and it worked perfectly for me.
> The problem here is not that much the generation of the image itself, but the
> generation of its mask. For example, in the example pictures below, the target
> is the cube, so I needed to generate automatically the image of the cube *and*
> its duplicate where every pixels matching the cube are black and all the others
> are white. I found that I could achieve this using the two textures below, one
> for the target, and one for everything else.
>
> #declare _texMaskTarget = texture {
> pigment { color Black }
> finish { ambient 0 }
> }
> #declare _texMaskNonTarget = texture {
> pigment { color White }
> finish { ambient 1 diffuse 100 }
> }
>
> Crafting the scene to my needs, adding randomness on the desired variable
> components of the scene, using the clock variable as the seed for the random
> generator, wrapping that in a Python script which generates and executes an INI
> file including the directive Declare=Mask=0 to switch between the normal texture
> and the mask texture, and I had a very handy tool to generate in minutes a data
> set of hundred of samples crafted to match perfectly any needed test case.
>
> If anyone has a better idea than my trick with the textures to generate the mask
> I would be glad to hear it.
>
> For those interested, everything is available on GitHub here:
> https://github.com/BayashiPascal/SDSIA
>
>
This looks fascinating - what a good way to use POVray!
Saw a great demo of Microsoft's Custom Vision AI services the other day.
More more info here:
https://www.customvision.ai/
Post a reply to this message
|
|