{"id":993,"date":"2022-09-12T18:00:59","date_gmt":"2022-09-12T18:00:59","guid":{"rendered":"http:\/\/summergeometry.org\/sgi2022\/?p=993"},"modified":"2022-09-15T13:47:45","modified_gmt":"2022-09-15T13:47:45","slug":"siren-architecture-colab-experiments","status":"publish","type":"post","link":"https:\/\/summergeometry.org\/sgi2022\/siren-architecture-colab-experiments\/","title":{"rendered":"SIREN Architecture: Colab Experiments"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">In this blog, we explain how we can train <a href=\"https:\/\/arxiv.org\/pdf\/2006.09661.pdf\">SIREN architecture<\/a> on a 3D point cloud (Dragon object), from <a href=\"http:\/\/graphics.stanford.edu\/data\/3Dscanrep\/\">The Stanford 3D Scanning Repository<\/a>. This work had been done during the&nbsp;project \u201c<em>Implicit Neural Representation (INR) based on the Geometric Information of Shapes<\/em>\u201d SGI 2022, with Alisia Lupidi and Krishnendu Kar, under the guidance of Dr. Dena Bazazian and Shaimaa Monem Abdelhafez.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span><b>Introduct<\/b><\/span><strong>ion<\/strong> <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The <a href=\"https:\/\/arxiv.org\/pdf\/2006.09661.pdf\">SIREN architecture<\/a> is a neural network with a periodic activation function that has been proposed to reconstruct 3D objects, and considered as a signed distance function (SDF). We train this network using a <a href=\"https:\/\/colab.research.google.com\/drive\/1h-y1Mb2lhbgSA9zWQbovtCMKVY-IeiJ4?usp=sharing\">colab notebook<\/a> to reconstruct a Dragon object, which we take from <a href=\"http:\/\/graphics.stanford.edu\/data\/3Dscanrep\/\">The Stanford 3D Scanning Repository<\/a>. We provide the instructions to produce our experiments.&nbsp;&nbsp;&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em>Note: you have to use a GPU for this experiment. If you use Google Colab, you just set your runtime to GPU<\/em>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Instructions to run our experiments<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">First, you have to clone the <a href=\"https:\/\/github.com\/vsitzmann\/siren\">SIREN repository<\/a> in your notebook using the code below,<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git clone https:\/\/github.com\/vsitzmann\/siren<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">After cloning the repository, install the required libraries by:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pip install sk-video \npip install cmapy \npip install ConfigArgParse\npip install plyfile<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Then, you can download the Dragon object from <a href=\"http:\/\/graphics.stanford.edu\/data\/3Dscanrep\/\">The Stanford 3D Scanning Repository<\/a> (you can also try another 3D object). The 3D object has to be converted to xyz format, for which you can use <a href=\"https:\/\/www.meshlab.net\/\">MeshLab<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The next step is to train the neural network (SIREN) to reconstruct the 3D object. You can achieve this task by running the following script:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>python experiments_scripts\/train_sdf.py --model_type=sine --point_cloud_path=&lt;path_to_the_Dragon_in_xyz_format&gt; --batch_size=25000 --experiment_name=experiment_1<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Finally, we can test the trained model and use it to reconstruct our Dragon by running,<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>python experiments_scripts\/test_sdf.py --checkpoint_path=&lt;path_to_the_checkpoint_of_the_trained_model&gt; --experiment_name=experiment_1_rec --resolution=512<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><em>The reconstructed point cloud file will be saved in the folder &#8220;experiment_1_rec&#8221;. Here is also visualization for the reconstructed Dragon (in gray) wrt to the original one (in brown) using&nbsp; <a href=\"https:\/\/www.meshlab.net\/\">MeshLab<\/a>. Where you can notice the reconstructed version&nbsp; has a larger scale.<\/em><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/summergeometry.org\/sgi2022\/wp-content\/uploads\/2022\/09\/Dragon_two-1024x829.png\" alt=\"\" class=\"wp-image-996\" width=\"610\" height=\"493\" srcset=\"https:\/\/summergeometry.org\/sgi2022\/wp-content\/uploads\/2022\/09\/Dragon_two-1024x829.png 1024w, https:\/\/summergeometry.org\/sgi2022\/wp-content\/uploads\/2022\/09\/Dragon_two-300x243.png 300w, https:\/\/summergeometry.org\/sgi2022\/wp-content\/uploads\/2022\/09\/Dragon_two-768x622.png 768w, https:\/\/summergeometry.org\/sgi2022\/wp-content\/uploads\/2022\/09\/Dragon_two-1536x1244.png 1536w, https:\/\/summergeometry.org\/sgi2022\/wp-content\/uploads\/2022\/09\/Dragon_two-1200x972.png 1200w, https:\/\/summergeometry.org\/sgi2022\/wp-content\/uploads\/2022\/09\/Dragon_two.png 1620w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><figcaption>The reconstructed Dragon (in gray) wrt to the original one (in brown) using&nbsp; <a href=\"https:\/\/www.meshlab.net\/\">MeshLab<\/a>.<\/figcaption><\/figure>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>In this blog, we explain how we can train SIREN architecture on a 3D point cloud (Dragon object), from The Stanford 3D Scanning Repository. This work had been done during the&nbsp;project \u201cImplicit Neural Representation (INR) based on the Geometric Information of Shapes\u201d SGI 2022, with Alisia Lupidi and Krishnendu Kar, under the guidance of Dr. [&hellip;]<\/p>\n","protected":false},"author":14,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[45],"tags":[],"class_list":["post-993","post","type-post","status-publish","format-standard","hentry","category-research"],"_links":{"self":[{"href":"https:\/\/summergeometry.org\/sgi2022\/wp-json\/wp\/v2\/posts\/993","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/summergeometry.org\/sgi2022\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/summergeometry.org\/sgi2022\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/summergeometry.org\/sgi2022\/wp-json\/wp\/v2\/users\/14"}],"replies":[{"embeddable":true,"href":"https:\/\/summergeometry.org\/sgi2022\/wp-json\/wp\/v2\/comments?post=993"}],"version-history":[{"count":8,"href":"https:\/\/summergeometry.org\/sgi2022\/wp-json\/wp\/v2\/posts\/993\/revisions"}],"predecessor-version":[{"id":1130,"href":"https:\/\/summergeometry.org\/sgi2022\/wp-json\/wp\/v2\/posts\/993\/revisions\/1130"}],"wp:attachment":[{"href":"https:\/\/summergeometry.org\/sgi2022\/wp-json\/wp\/v2\/media?parent=993"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/summergeometry.org\/sgi2022\/wp-json\/wp\/v2\/categories?post=993"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/summergeometry.org\/sgi2022\/wp-json\/wp\/v2\/tags?post=993"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}