Hey Raj,
supposing you have a project with dense cloud generated in a chunk. Then you would open each file corresponding toaphoto and read each polygon inside the file.
Supposing you read the list of vertex coordinates of first polygon in file as polygon[0]=list((x0,y0), (x1, y1), ....
vertices = list()
for (x,y) in polygon[0]:
ray_origin = camera.unproject(Metashape.Vector([x, y, 0]))
ray_target = camera.unproject(Metashape.Vector([x, y, 1]))
vertices.append(chunk.crs.project(T.mulp(surface.pickPoint(ray_origin, ray_target))))
shape = chunk.shapes.addShape()
shape.attributes["Photo"] = camera.label
shape.type = Metashape.Shape.Type.Polygon
shape.vertices =vertices
shape.has_z = True
where T = chunk.transform, camera is photo where polygon appears,
and surface = chunk.dense_cloud
I think this can give you a good base for developping your script and look at attached script as a starting point as it projects onto model surface the 4 corners of each photo as footprint shape...