I am referring to the following link.
Replicator Materials — Omniverse Extensions latest documentation (nvidia.com)
I want to perform semantic segmentation on images projected through projection mapping. I am experimenting with various images, but there are images for which semantic segmentation is successful and others for which it is not.
It works well with images of smileys, but it seems to be unsuccessful with images other than smileys.
What do you think this issue depends on?
I tried the folloing images.
Hi there, is the
Copper_ORM material semantically annotated?
Here is the code.
from pxr import Usd, UsdGeom
from pathlib import Path
import omni.replicator.core as rep
# Axis and unitscale can also be set optionally
distance_light = rep.create.light(rotation=(400,-23,-94), intensity=10000, light_type="distant")
camera = rep.create.camera(position=(0,280,310),rotation = (-45,0,0))
render_product = rep.create.render_product(camera, (1024, 1024))
stage = omni.usd.get_context().get_stage()
plane = rep.create.plane(position=(50, 100, 0), rotation=(0, 45, 10))
cube = rep.create.cube(visible=False, semantics=[('class', 'cube')], position=(0, 0, 0), rotation=(0, 0, 90), scale=(0.2, 0.2, 0.2))
sem = [('class', 'shape')]
# Randomizer for scattering
shapes = rep.get.prims(semantics=[('class', 'cube')])
# Create the projection with the plane as the target
proj1 = rep.create.projection_material(cube, sem)
# Modify the cube position, and update the projection
There is no difference in the labeling state between using Copper_ORM and using smiley. Both have Semantic labels attached to Plane_Cube_Xform.
It seems the second material is projected on the whole plane, that is why the whole plane is semantically annotated (blue). If you for example remove the semantics from the cube it will disappear.
Thank you for your response.
Is there a way to narrow down semantic segmentation only to the area of projection mapping, rather than projecting onto the entire plane?
I’m considering whether this example could be used for training appearance inspection of scratches on cars.
By the way, I was able to successfully perform semantic segmentation with the bird icon in the following link.
Is it important for the image used in projection mapping to be 512x512 pixels?
File:Icon Bird 512x512.png - Wikimedia Commons
i wonder if the images with transparent alpha vs an image without alpha matters, also?
I believe the issue you’re running into is that the alpha (transparency) is taken from the diffuse/color image, and that some of the image you’re using don’t have an alpha channel. The png of the bird looks like it does though. I’ll make this requirement a bit more visible in the docs.
Question, what’s the preferred method ? Packing the alpha into the color image is about the closest thing to a “standard” for image transparency, but an optional input for a separate opacity might be nice to have (though the channel packing into the colormap is more efficient).
Welcome any thoughts on this.