Skip to content

Instantly share code, notes, and snippets.

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

Giseop Kim gisbi-kim

💭
I may be slow to respond.
View GitHub Profile
@gisbi-kim
gisbi-kim / gist:c93cf0400a32dc7fe7e74caef420615d
Created September 3, 2024 04:34
recent arxiv papers within a single webpage
https://www.arxiv.org/list/cs.RO/pastweek?skip=0&show=2000
https://www.arxiv.org/list/cs.CV/pastweek?skip=0&show=2000
@gisbi-kim
gisbi-kim / chat.md
Created October 3, 2023 07:08
Why Lambda in a Loop is a Code Smell in python? Also it happens in c++?

Using a lambda (or any function) in a loop can be considered a code smell in Python (and often in other languages like C++) for several reasons. Here's why it can be problematic:

1. Closure Binding Issue:

In Python, using a lambda function in a loop can lead to unexpected behavior due to late binding. This means the lambda function captures the variable, not the value. So, if the lambda uses loop variables, it will use the final value of the variable, not the value it had when the function was defined.

funcs = [lambda x: x + i for i in range(3)]
for func in funcs:
@gisbi-kim
gisbi-kim / cuda-pin-vs-unpin-experiment.ipynb
Created July 21, 2023 15:41
cuda pin vs unpin experiment .ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gisbi-kim
gisbi-kim / stablediffusionwalk.py
Created August 29, 2022 00:50 — forked from karpathy/stablediffusionwalk.py
hacky stablediffusion code for generating videos
"""
stable diffusion dreaming
creates hypnotic moving videos by smoothly walking randomly through the sample space
example way to run this script:
$ python stablediffusionwalk.py --prompt "blueberry spaghetti" --name blueberry
to stitch together the images, e.g.:
$ ffmpeg -r 10 -f image2 -s 512x512 -i blueberry/frame%06d.jpg -vcodec libx264 -crf 10 -pix_fmt yuv420p blueberry.mp4
@gisbi-kim
gisbi-kim / iphoneMappingWallSlantAngle.py
Last active August 30, 2021 07:39
iphoneMappingWallSlantAngle.py
import numpy as np
import matplotlib.pyplot as plt
import open3d as o3d
from pytictoc import TicToc # pip install pytictoc
# start
t = TicToc()
t.tic()
# option
@gisbi-kim
gisbi-kim / makePNVLADscans.py
Created August 28, 2021 15:13
PointNetVlad input generation (0.1m pre-downsampling, ground-removal, [-1, 1] normalization, 4096 points)
import sys
import os
import numpy as np
import open3d as o3d
from utils import *
# params
num_pnvlad_points = 4096
# dataset setting
import os
import sys
import time
import copy
import numpy as np
import open3d as o3d
#
parent_dir = 'ScanNet/scans'
seq_dir_names = os.listdir(parent_dir)
@gisbi-kim
gisbi-kim / understanding_how_constrastive_loss_works.m
Last active April 24, 2021 04:11
Understanding how a constrastive loss works
%% Understanding how a constrastive loss works
% constrastive loss refs:
% - Kihyuk Sohn. Improved deep metric learning with multi- class n-pair loss objective. In Advances in Neural Informa- tion Processing Systems (NeurIPS), 2016.
% - Aaron van den Oord, Yazhe Li, and Oriol Vinyals. Repre- sentation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748, 2018.
% - Zaiwei Zhang et al. Self-Supervised Pretraining of 3D Features on any Point-Cloud, 2021
%% param
num_negs = 100;
@gisbi-kim
gisbi-kim / octreeDownsampling.cpp
Created February 12, 2021 09:28
octreeDownsampling.cpp
/*
purpose: voxeldownsampling in pcl sometimes fails for a large-scale point cloud
*/
void octreeDownsampling(const pcl::PointCloud<PointType>::Ptr &_src,
pcl::PointCloud<PointType>::Ptr &_to_save,
const float _kDownsampleVoxelSize)
{
pcl::octree::OctreePointCloudVoxelCentroid<PointType> octree(_kDownsampleVoxelSize);
octree.setInputCloud(_src);
function [files] = listdir(dir_path)
files = dir(dir_path);
files(1:2) = []; % remove . and ..
files = {files(:).name};
end