Skip to content

Instantly share code, notes, and snippets.

View asetsuna's full-sized avatar
💭
I may be slow to respond.

asetsuna

💭
I may be slow to respond.
View GitHub Profile
@asetsuna
asetsuna / TexturedMeshSteps.md
Created June 22, 2022 15:25 — forked from shubhamwagh/TexturedMeshSteps.md
Steps to create textured mesh from point cloud using Meshlab

Steps to create Textured Mesh from Point Cloud using Meshlab

Get your PointCloud into MeshLab

  • Import the pointcloud file in ".ply" file format in Meshlab. Before importing make sure you do some pre-processing / cleaning on point cloud so as to ease the process of meshing.

Point Cloud Simplification and Normals Computation

  • Next we need to reduce the number of point samples for smooth meshing.
    • So go to Filters -> Point Set -> Point Cloud Simplification. Enter Number of samples circa 5% of original number of points. Make sure Best Sample Heuristic is checked.
  • After point cloud simplification, make sure to select Simplified point cloud in the Show Layer Dialog on the right hand side. If not visible, it can be opened by navigating to View -> Show Layer Dialog. Now we need to compute normals for point set.
  • So go to Filters -> Point Set -> Compute normals for point sets . Enter Neighbour num between 10 - 100. Initially try with 10 and
@asetsuna
asetsuna / pytorch_bilinear_interpolation.md
Created August 16, 2018 18:51 — forked from peteflorence/pytorch_bilinear_interpolation.md
Bilinear interpolation in PyTorch, and benchmarking vs. numpy

Here's a simple implementation of bilinear interpolation on tensors using PyTorch.

I wrote this up since I ended up learning a lot about options for interpolation in both the numpy and PyTorch ecosystems. More generally than just interpolation, too, it's also a nice case study in how PyTorch magically can put very numpy-like code on the GPU (and by the way, do autodiff for you too).

For interpolation in PyTorch, this open issue calls for more interpolation features. There is now a nn.functional.grid_sample() feature but at least at first this didn't look like what I needed (but we'll come back to this later).

In particular I wanted to take an image, W x H x C, and sample it many times at different random locations. Note also that this is different than upsampling which exhaustively samples and also doesn't give us fle

@asetsuna
asetsuna / ipynb_to_gallery.py
Created August 1, 2018 05:27 — forked from chsasank/ipynb_to_gallery.py
Convert jupyter notebook to sphinx gallery notebook styled examples.
@asetsuna
asetsuna / tf-roialign.py
Created July 23, 2018 16:04
tf-roialign
# 作者:吴育昕
# 链接:https://www.zhihu.com/question/286255813/answer/449907307
import numpy as np
import tensorflow as tf
def crop_and_resize(image, boxes, box_ind, crop_size, pad_border=True):
"""
Aligned version of tf.image.crop_and_resize, following our definition of floating point boxes.
@asetsuna
asetsuna / smallpt_tf.py
Created May 6, 2018 13:28
small pathtracer implemented by using tensorflow
# coding: utf-8
"""
シンプルなパストレーサー
cf. http://www.kevinbeason.com/smallpt/
"""
import shutil
import numpy as np
import tensorflow as tf
@asetsuna
asetsuna / raytracing.py
Created October 22, 2017 04:29 — forked from rossant/raytracing.py
Very simple ray tracing engine in (almost) pure Python. Depends on NumPy and Matplotlib. Diffuse and specular lighting, simple shadows, reflections, no refraction. Purely sequential algorithm, slow execution.
"""
MIT License
Copyright (c) 2017 Cyrille Rossant
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
const {
aceVimMap,
mapkey,
imap,
imapkey,
getClickableElements,
vmapkey,
map,
unmap,
vunmap,