Skip to content

Instantly share code, notes, and snippets.

View ZachL1's full-sized avatar
🎯
Focusing

Duan Zhichao ZachL1

🎯
Focusing
  • Xidian University
  • China
  • 11:21 (UTC +08:00)
View GitHub Profile
@ZachL1
ZachL1 / cuda_conda_Dockerfile
Created May 29, 2024 09:00
A simple Dockerfile to create the most basic containers containing cuda, conda and torch.
# docker build -t zach/cuda_conda:cu118-torch21 . --network host
# sudo docker run --gpus all -it --ipc=host --ulimit memlock=-1 --ulimit stack=67108864 --user root -v /mnt/:/mnt/ -v ~/workspace/:~/workspace/ --network host zach/cuda_conda:cu118-torch21
FROM nvidia/cuda:11.8.0-cudnn8-devel-ubuntu22.04
# Add some dependencies
RUN sed -i 's#http://archive.ubuntu.com/#http://mirrors.tuna.tsinghua.edu.cn/#' /etc/apt/sources.list
@ZachL1
ZachL1 / unproject_omnidata_point.py
Created June 13, 2024 15:17
Parse Omnidata's camera intrinsic and pose and convert them to OpenCV format, also provide an example of back-projection to 3D point cloud.
import json
import math
import numpy as np
import cv2
import torch
from plyfile import PlyData, PlyElement
from pytorch3d.transforms import euler_angles_to_matrix
from pytorch3d.renderer import FoVPerspectiveCameras
# Copied from omnidata, which is badly named, the function returns what is actually world_to_camera