{"id":808,"date":"2024-10-10T14:42:13","date_gmt":"2024-10-10T18:42:13","guid":{"rendered":"https:\/\/brian.digitalmaddox.com\/blog\/?p=808"},"modified":"2024-10-10T14:42:13","modified_gmt":"2024-10-10T18:42:13","slug":"stupid-lidar-tricks-finale","status":"publish","type":"post","link":"https:\/\/brian.digitalmaddox.com\/blog\/?p=808","title":{"rendered":"Stupid LIDAR Tricks Finale"},"content":{"rendered":"<p>I thought I&#8217;d finally wrap this up so I can move on to other things.\u00a0 Since I&#8217;ve last posted, I replaced my Jankinator 1000 (<a href=\"https:\/\/www.nvidia.com\/content\/dam\/en-zz\/Solutions\/design-visualization\/documents\/nvidia-p40-datasheet.pdf\">nVidia Tesla P40<\/a> with a water cooler) and my nVidia <a href=\"https:\/\/www.nvidia.com\/en-us\/geforce\/news\/nvidia-geforce-rtx-2060\/\">RTX 2060<\/a> with an <a href=\"https:\/\/www.intel.com\/content\/www\/us\/en\/products\/sku\/229151\/intel-arc-a770-graphics-16gb\/specifications.html\">Intel Arc A770<\/a>.\u00a0 It has 16Gb of VRAM and is actually a pretty fast GPU on my Linux box.<\/p>\n<p>So far I&#8217;ve had pretty good luck getting things like TensorFlow and PyTorch working on it, as mentioned in a previous <a href=\"https:\/\/brian.digitalmaddox.com\/blog\/?p=793\">blog post<\/a>.\u00a0 The only thing so far that I haven&#8217;t gotten to work 100% is Facebook&#8217;s <a href=\"https:\/\/ai.meta.com\/sam2\/\">Segment Anything Model 2<\/a> (SAM2) (which of course is what I mentioned in the last post I wanted to try to use with the LIDAR GeoTIFF).\u00a0 Basically now down to running out of VRAM although I&#8217;m not sure exactly why since I&#8217;ve tweaked settings for OpenCL memory allocation on Linux, etc.\u00a0 I&#8217;ve finally given up on that one for now and decided to just use the CPU for processing.<\/p>\n<p>As a refresher, here is the LIDAR GeoTIFF I have been using.<\/p>\n<p><a href=\"https:\/\/brian.digitalmaddox.com\/blog\/wp-content\/uploads\/2024\/05\/Output_screenshot5.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-medium wp-image-762\" src=\"https:\/\/brian.digitalmaddox.com\/blog\/wp-content\/uploads\/2024\/05\/Output_screenshot5-300x145.png\" alt=\"\" width=\"300\" height=\"145\" srcset=\"https:\/\/brian.digitalmaddox.com\/blog\/wp-content\/uploads\/2024\/05\/Output_screenshot5-300x145.png 300w, https:\/\/brian.digitalmaddox.com\/blog\/wp-content\/uploads\/2024\/05\/Output_screenshot5-1024x494.png 1024w, https:\/\/brian.digitalmaddox.com\/blog\/wp-content\/uploads\/2024\/05\/Output_screenshot5-768x370.png 768w, https:\/\/brian.digitalmaddox.com\/blog\/wp-content\/uploads\/2024\/05\/Output_screenshot5-500x241.png 500w, https:\/\/brian.digitalmaddox.com\/blog\/wp-content\/uploads\/2024\/05\/Output_screenshot5.png 1458w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>SAM2 has the ability to automatically generate masks on input images.\u00a0 This was of interest to me since I wanted to test it to try to automatically identify areas of interest from LIDAR.\u00a0 Fortunately, the <a href=\"https:\/\/github.com\/facebookresearch\/sam2\">GitHub repo for SAM2<\/a> has a <a href=\"https:\/\/jupyter.org\/\">Jupyter<\/a> <a href=\"https:\/\/github.com\/facebookresearch\/sam2\/blob\/main\/notebooks\/automatic_mask_generator_example.ipynb\">notebook<\/a> that made it easy to run some experiments.<\/p>\n<p><a href=\"https:\/\/brian.digitalmaddox.com\/blog\/wp-content\/uploads\/2024\/10\/first_sam2_run.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-medium wp-image-809\" src=\"https:\/\/brian.digitalmaddox.com\/blog\/wp-content\/uploads\/2024\/10\/first_sam2_run-300x147.png\" alt=\"\" width=\"300\" height=\"147\" srcset=\"https:\/\/brian.digitalmaddox.com\/blog\/wp-content\/uploads\/2024\/10\/first_sam2_run-300x147.png 300w, https:\/\/brian.digitalmaddox.com\/blog\/wp-content\/uploads\/2024\/10\/first_sam2_run-1024x500.png 1024w, https:\/\/brian.digitalmaddox.com\/blog\/wp-content\/uploads\/2024\/10\/first_sam2_run-768x375.png 768w, https:\/\/brian.digitalmaddox.com\/blog\/wp-content\/uploads\/2024\/10\/first_sam2_run-1536x750.png 1536w, https:\/\/brian.digitalmaddox.com\/blog\/wp-content\/uploads\/2024\/10\/first_sam2_run-500x244.png 500w, https:\/\/brian.digitalmaddox.com\/blog\/wp-content\/uploads\/2024\/10\/first_sam2_run.png 1570w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>With all of the default parameters, we can see that it only identified the lower right corner of the image.\u00a0 I tweaked a few of the settings and came up with this version:<\/p>\n<p><a href=\"https:\/\/brian.digitalmaddox.com\/blog\/wp-content\/uploads\/2024\/10\/second_sam2_run.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-medium wp-image-810\" src=\"https:\/\/brian.digitalmaddox.com\/blog\/wp-content\/uploads\/2024\/10\/second_sam2_run-300x147.png\" alt=\"\" width=\"300\" height=\"147\" srcset=\"https:\/\/brian.digitalmaddox.com\/blog\/wp-content\/uploads\/2024\/10\/second_sam2_run-300x147.png 300w, https:\/\/brian.digitalmaddox.com\/blog\/wp-content\/uploads\/2024\/10\/second_sam2_run-1024x500.png 1024w, https:\/\/brian.digitalmaddox.com\/blog\/wp-content\/uploads\/2024\/10\/second_sam2_run-768x375.png 768w, https:\/\/brian.digitalmaddox.com\/blog\/wp-content\/uploads\/2024\/10\/second_sam2_run-1536x750.png 1536w, https:\/\/brian.digitalmaddox.com\/blog\/wp-content\/uploads\/2024\/10\/second_sam2_run-500x244.png 500w, https:\/\/brian.digitalmaddox.com\/blog\/wp-content\/uploads\/2024\/10\/second_sam2_run.png 1570w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>The second image does show some areas highlighted.\u00a0 It got a grouping of row houses on the bottom of the image.\u00a0 It also found a few single family houses as well.\u00a0 However, it also flagged areas where there is really nothing of interest.<\/p>\n<h2>Finale<\/h2>\n<p>What have we learned from all of this?\u00a0 Well, LIDAR is hard.\u00a0 Automatically finding features of interest in LIDAR is also hard.\u00a0 We can get some decent results using image processing and\/or deep learning techniques, but as with anything in the field, we are no where near 100%.<\/p>\n<p><a href=\"https:\/\/brian.digitalmaddox.com\/blog\/?p=747\">Previously<\/a> I posted about training a custom RCNN to identify features of interest from GeoTIFF LIDAR.\u00a0 It was somewhat successful, although, as I said, it needed a lot more training data than I had available.<\/p>\n<p>I do think that over time, people will develop models that do a good job of finding certain areas of interest in LIDAR.\u00a0 Some fields already have software to find specific features in LIDAR, especially in fields such as archaeology.\u00a0 And this is probably how things will continue for a while.\u00a0 We probably will not have a generalized &#8220;find everything of interest in this LIDAR image&#8221; model or software for a long time.\u00a0 However, it is possible to train a model to identify specific areas.<\/p>\n<p>I am also working with LIDAR <a href=\"https:\/\/medium.com\/@matt-sharon\/lidar-point-cloud-data-guide-62c126101c08\">point<\/a> data as well versus GeoTIFF versions.\u00a0 Point data is a lot different beast in that it has various <a href=\"https:\/\/gisgeography.com\/lidar-light-detection-and-ranging\/\">classifications<\/a> of the points after it has been processed.\u00a0 You can then do things such as extract tree canopy points or bare ground points.\u00a0 Conversion to a raster necessarily looses information as things have to be interpolated and reduced in order to produce a raster.\u00a0 I&#8217;ll post some things here in the future as while point cloud data can be harder to work with, I think the results are better than what can be obtained via rasters.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I thought I&#8217;d finally wrap this up so I can move on to other things.\u00a0 Since I&#8217;ve last posted, I replaced my Jankinator 1000 (nVidia Tesla P40 with a water cooler) and my nVidia RTX 2060 with an Intel Arc &hellip; <a href=\"https:\/\/brian.digitalmaddox.com\/blog\/?p=808\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":810,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-808","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-gis"],"_links":{"self":[{"href":"https:\/\/brian.digitalmaddox.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/808","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/brian.digitalmaddox.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/brian.digitalmaddox.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/brian.digitalmaddox.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/brian.digitalmaddox.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=808"}],"version-history":[{"count":3,"href":"https:\/\/brian.digitalmaddox.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/808\/revisions"}],"predecessor-version":[{"id":813,"href":"https:\/\/brian.digitalmaddox.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/808\/revisions\/813"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/brian.digitalmaddox.com\/blog\/index.php?rest_route=\/wp\/v2\/media\/810"}],"wp:attachment":[{"href":"https:\/\/brian.digitalmaddox.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=808"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/brian.digitalmaddox.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=808"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/brian.digitalmaddox.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=808"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}