Seems like you are passing a vertex though you named it coord
.
coords_2d = [world_to_camera_view(scene, cam, v.co) for v in face.vertices ]
face.vertices
does not contain a collection of mesh vertices, but a list of vertex indices. You need to retrieve the actual vertex and use its coordinate (v.co
).