Skip to content

Instantly share code, notes, and snippets.

View sagniklp's full-sized avatar
🏁
Deadline Time

Sagnik Das sagniklp

🏁
Deadline Time
View GitHub Profile
@sagniklp
sagniklp / cappc.py
Created March 16, 2022 18:54
Using Realsense D415 to capture point clouds
'''
This code was used to capture documents for the Doc3D dataset
For a document it captures the point cloud and the segmentation map
This code uses python (2.7) and pyrealsense2 (2.16) and may be incompatiable with newer versions of pyrealsense2
Related publication: DewarpNet: Single-Image Document Unwarping With Stacked 3D and 2D Regression Networks (ICCV 2019)
Contributed by: Ke Ma and Sagnik Das (Spring 2019)
Correspndence: sadas@cs.stonybrook.edu
Acknowledgemnts: This code uses snippets from pyrealsense2 tutorials
'''
@sagniklp
sagniklp / msb_raw_reader.ipynb
Created September 7, 2019 03:21
OmniVision '.msb_raw' reader using ImageMagick/OpenCV
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sagniklp
sagniklp / sobel_pytorch.py
Last active May 17, 2022 09:23
Sobel Gradient using PyTorch
# Helpful Tips: https://stackoverflow.com/questions/9567882/sobel-filter-kernel-of-large-size/
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import numpy as np
np.set_printoptions(threshold=np.nan)
from math import exp
import cv2
import matplotlib.pyplot as plt
@sagniklp
sagniklp / DeformNet.md
Last active December 7, 2018 23:19
Paper Summary: Geometry-Aware Network for Non-Rigid Shape Prediction from a Single View

Motivations:

  • Predicting 3D shape of a deformable non-rigid surface from a single image.
  • Original paradigm is SfT (Shape-from-Template) requires a reference template image of the surface for which the 3D geometry is known, and a set of 3D-to-2D point correspondences or a mapping between this template and the input image. This method struggles with low-textured surfaces.

Goals:

  • This methods idea builds upon designing a method capable of predicting geometrically consistent 3D shape without relying on point correspondences.
  • Robustness to lack of texture, large occlusion, corrupted object boundaries and varying lighting conditions.
  • An end-to-end fully differentiable network.

Contributions:

@sagniklp
sagniklp / organize_pc.py
Created October 17, 2018 20:04
A simple python snippet to organize a random point cloud
import os
import numpy as np
import tqdm
inp_pc_path='./simple.xyz' #input point cloud
out_pc_path='./simple_org.xyz' #output point cloud
points=[]
org_points=[]
with open(inp_pc_path,'r') as f:
@sagniklp
sagniklp / ColorMaptoRGB.ipynb
Created October 10, 2018 02:55
Sample colors from a Matplotlib colormap and plot corresponding RGB values
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sagniklp
sagniklp / Pix2Pix.md
Last active September 29, 2018 00:05
Paper Summary: Image-to-Image Translation with Conditional Adversarial Networks (https://arxiv.org/pdf/1611.07004v1.pdf)

Motivations:

  • Image-to-Image translation is a classical problem in image processing, graphics and vision.
  • Requires manual effort to design "what to minimize" (loss), also being "careful what we wish for".
  • Same architecture and objective of mapping two images with different training data without any manual mapping functions.

Being a traditionalist, what we could do?

  • Take a CNN, find what loss works with your training data
  • Maybe, just minimize the Euclidean distance of the ground-truth and predicted pixels. Result: Blurry Images

Goals: