ranahanocka / MeshCNN

Convolutional Neural Network for 3D meshes in PyTorch
MIT License
1.58k stars 316 forks source link

How to prepare our own datasets for Segmentation ? #54

Open jay-thakur opened 4 years ago

jay-thakur commented 4 years ago

Hi,

Thank you so much for this repo. This is really helpful & very impressive work.

I am able to run the code & produce the output as expected. However I am looking to run this code on shapenet dataset (having chairs, table etc...). Could you please help me to preprocess(prepare) our own dataset for segmentation.

Also it would be great if you can share any such datasets link for mesh segmentation.

Thanks, Jay

ranahanocka commented 4 years ago

Hi @jay-thakur ,

I think you said you were looking for how to create the .edges file that the segmentation dataset prep code expects right? You should export the .edges file from the Mesh class in the python code. Here is the deprecated function that did it:

def save_new_edges(filename):
    mesh = Mesh(filename, shuffle=False)
    edges = np.array(mesh.edges)
    edge_file = filename.replace('.obj', '.edges')
    np.savetxt(edge_file, edges, fmt='%d')
Pavelevivan commented 4 years ago

Hi, Can you explain what is the order to get dataset for segmentation: obj -> edges -> seg -> eseg (is that correct?) I downloaded your scripts on matlab, but quite frustrated on them because I do not have experience with it. Could you explain me that? I would really appreciate your help.

Thanks, Ivan

yuvaramsingh94 commented 4 years ago

Hi, i am also on the same page . i like to create the .seseg file for my own dataset . is there any python code available for it . as i am not that used to matlab.

Also i like to know is there any code/strategy available to map .eseg annotation of one resolution .obj file to a lower resolution . i am planning to figure out the best resolution for my work so planning to label(.eseg) in higher resolution and convert it to other resolutions so i wont have to do the labeling all over again .

ranahanocka commented 4 years ago

Hi @Pavelevivan

obj -> edges -> seg -> eseg (is that correct?)

Yes, that is correct. I think if you try to reproduce the example from the MATLAB scripts it will be clear

ranahanocka commented 4 years ago

Hi @yuvaramsingh94 ,

The matlab code maps the segmentation from one resolution to another (it computes some graph cut optimization to do that). Unfortunately, there is only matlab code to do this.

KevinJianLin commented 1 year ago

In this function, filename is .obj file. I got this error, AttributeError: 'NoneType' object has no attribute 'num_aug'. Do I need to place my .obj file under specific folder to avoid this error?

def save_new_edges(filename): mesh = Mesh(filename, shuffle=False) edges = np.array(mesh.edges) edge_file = filename.replace('.obj', '.edges') np.savetxt(edge_file, edges, fmt='%d')

KevinJianLin commented 1 year ago

@jay-thakur does the function work for you? @ranahanocka Is there previous commit to checkout save_new_edges function?

jay-thakur commented 1 year ago

Hi,

I had tried this 3-4 yrs ago, tbh I don't remember now.

Thanks, Jay

On Mon, Jun 26, 2023 at 8:26 AM Kevin Lin @.***> wrote:

@jay-thakur https://github.com/jay-thakur does the function work for you? @ranahanocka https://github.com/ranahanocka Is there previous commit to checkout save_new_edges function?

— Reply to this email directly, view it on GitHub https://github.com/ranahanocka/MeshCNN/issues/54#issuecomment-1607719279, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAVEY5KTQ3UE6WY5XGWNP7DXNGS2VANCNFSM4J4F5F6Q . You are receiving this because you were mentioned.Message ID: @.***>