Enigma-li/Free2CAD

How to Generate 3D CAD Models from 2D Sketches Using Given Model Configuration?

Opened this issue · 2 comments

Hello,

I've successfully obtained the configuration details for several models, but I'm unclear on how to utilize them for converting 2D sketches into 3D CAD models. Specifically, I'm puzzled about where to input my 2D sketch and how the regNet_300k model can generate a 3D CAD model from a sketch, especially when dealing with unusual shapes.

Here are the input and output specifications for each model:

embedSNet Input and Output Names and Shapes:

  • Signature: serving_default
    • Input Name: input_tensor, Shape: (None, 256, 256, 1), Dtype: <dtype: 'float32'>
    • Output Name: output_recons, Shape: (None, 256, 256, 1), Dtype: <dtype: 'float32'>
    • Output Name: output_code, Shape: (None, 256), Dtype: <dtype: 'float32'>

gpTFNet_250k Input and Output Names and Shapes:

  • Signature: serving_default
    • Input Name: dec_padding_mask, Shape: (1, 1, 1, None), Dtype: <dtype: 'float32'>
    • Input Name: look_ahead_mask, Shape: (1, 1, None, None), Dtype: <dtype: 'float32'>
    • Input Name: inp, Shape: (1, None, 256), Dtype: <dtype: 'float32'>
    • Input Name: tar, Shape: (1, None, 256), Dtype: <dtype: 'float32'>
    • Input Name: enc_padding_mask, Shape: (1, 1, 1, None), Dtype: <dtype: 'float32'>
    • Output Name: res_group_label, Shape: (None, None, None), Dtype: <dtype: 'float32'>

regNet_300k Input and Output Names and Shapes:

  • Signature: serving_default
    • Input Name: gp_S_map, Shape: (1, None, 256, 256, 1), Dtype: <dtype: 'float32'>
    • Input Name: gp_ND_maps, Shape: (1, None, 256, 256, 4), Dtype: <dtype: 'float32'>
    • Output Name: base_curve, Shape: (None, None, 256, 256, 1), Dtype: <dtype: 'float32'>
    • Output Name: face_map, Shape: (None, None, 256, 256, 1), Dtype: <dtype: 'float32'>

Given these details, could you guide me on the correct process for feeding my 2D sketch into the system and using regNet_300k to create a 3D CAD model? Any insights or examples would be greatly appreciated.

Thank you!

I think you should read about the demo code under the folder dataAndModel. By only running the network is not enough, geometry optimization is needed.

But the signature tells you how to fill in tensors for the network.

@Enigma-li, thanks for your reply. However, could you provide a more detailed tutorial on using the available checkpoints model for feeding the 2D sketch and outputting the generated 3D CAD? I still find the README.md confusing. Thank you.