POV-Ray : Newsgroups : povray.binaries.images : Synthetic data sets for image analysis Server Time: 25 Apr 2019 22:26:33 GMT
  Synthetic data sets for image analysis (Message 1 to 6 of 6)  
From: BayashiPascal
Subject: Synthetic data sets for image analysis
Date: 27 Jan 2019 06:45:00
Message: <web.5c4d52ac5c0b0917ce2d55280@news.povray.org>
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


Post a reply to this message


Attachments:
Download 'sdsia.jpg' (83 KB)

Preview of image 'sdsia.jpg'
sdsia.jpg


 

From: Alain
Subject: Re: Synthetic data sets for image analysis
Date: 27 Jan 2019 18:13:36
Message: <5c4df4d0$1@news.povray.org>
Le 19-01-27 à 01:43, BayashiPascal a écrit :
> 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
> 
> 

You can also use the quality setting.
If you set the pigment of the box to rgb 0, the pigment of everything 
else to rgb 1, and use +q0 on the command line, you'll get the same 
result. The advantage is that it should be faster as no light are used.

When using +q0 the following happen :
ALL light are ignored.
EVERYTHING is rendered assuming full ambient only.
Diffuse is ignored.
There are no shadow.
Radiosity is disabled.
Reflections are ignored.

The quality setting can be set via an ini file or on the command line.


Post a reply to this message

From: BayashiPascal
Subject: Re: Synthetic data sets for image analysis
Date: 28 Jan 2019 13:45:01
Message: <web.5c4f066e4332cefdce2d55280@news.povray.org>
Indeed !
From 1m16s to 53s on the example data set of the repository. Thank you very much
Alain ! :-)


Alain <kua### [at] videotronca> wrote:
> You can also use the quality setting.
> If you set the pigment of the box to rgb 0, the pigment of everything
> else to rgb 1, and use +q0 on the command line, you'll get the same
> result. The advantage is that it should be faster as no light are used.
>
> When using +q0 the following happen :
> ALL light are ignored.
> EVERYTHING is rendered assuming full ambient only.
> Diffuse is ignored.
> There are no shadow.
> Radiosity is disabled.
> Reflections are ignored.
>
> The quality setting can be set via an ini file or on the command line.


Post a reply to this message

From: Mike Horvath
Subject: Re: Synthetic data sets for image analysis
Date: 19 Feb 2019 05:30:00
Message: <5c6b9458$1@news.povray.org>
On 1/27/2019 1:14 PM, Alain wrote:
> Le 19-01-27 à 01:43, BayashiPascal a écrit :
>> 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
>>
>>
> 
> You can also use the quality setting.
> If you set the pigment of the box to rgb 0, the pigment of everything 
> else to rgb 1, and use +q0 on the command line, you'll get the same 
> result. The advantage is that it should be faster as no light are used.
> 
> When using +q0 the following happen :
> ALL light are ignored.
> EVERYTHING is rendered assuming full ambient only.
> Diffuse is ignored.
> There are no shadow.
> Radiosity is disabled.
> Reflections are ignored.
> 
> The quality setting can be set via an ini file or on the command line.

I wonder if this would work for video game shadow sprites too.


Mike


Post a reply to this message

From: Reuben Pearse
Subject: Re: Synthetic data sets for image analysis
Date: 4 Mar 2019 07:18:10
Message: <5c7cd132$1@news.povray.org>
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

From: BayashiPascal
Subject: Re: Synthetic data sets for image analysis
Date: 4 Mar 2019 12:30:00
Message: <web.5c7d19954332cefd24366d850@news.povray.org>
Thank you Reuben !

Yes any big company in computer science launches its own version of this kind of
service nowadays. But that's really as easy and efficient as they pretend...

Pascal


Reuben Pearse <reu### [at] gmailcom> wrote:
> 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

Copyright 2003-2008 Persistence of Vision Raytracer Pty. Ltd.