Skip to content

Instantly share code, notes, and snippets.

View ramsafin's full-sized avatar

Ramil Safin ramsafin

View GitHub Profile
@ramsafin
ramsafin / Dockerfile
Last active February 25, 2026 07:46
COLMAP Docker Build (with CUDA)
# syntax=docker/dockerfile:1.7
ARG NVIDIA_CUDA_VERSION=13.1.1
ARG UBUNTU_VERSION=24.04
# ----------------------------
# Builder
# ----------------------------
FROM nvidia/cuda:${NVIDIA_CUDA_VERSION}-devel-ubuntu${UBUNTU_VERSION} AS builder
# syntax=docker/dockerfile:1.7
ARG TORCH_IMAGE_TAG=2.10.0-cuda13.0-cudnn9
# --- Builder ---
FROM pytorch/pytorch:${TORCH_IMAGE_TAG}-devel AS builder
ENV DEBIAN_FRONTEND=noninteractive \
PIP_BREAK_SYSTEM_PACKAGES=1 \
PIP_ROOT_USER_ACTION=ignore \
@ramsafin
ramsafin / colmap-guide.md
Last active February 21, 2026 17:08
COLMAP Usage

COLMAP Usage Guide

A guide to running COLMAP for structure-from-motion (SfM) and multi-view stereo (MVS).

Tested on: COLMAP 3.13 (CUDA, ceres-solver cuDSS).

Reference: https://colmap.github.io/

Overview

@ramsafin
ramsafin / prune_motion.py
Created February 19, 2026 20:16
Prune image frames based on motion score similarity
#!/usr/bin/env python3
from __future__ import annotations
import argparse
import math
from pathlib import Path
from typing import List, Tuple
import numpy as np
from PIL import Image

CUDA with Docker on WSL2

This guide covers:

  • Installing CUDA Toolkit inside Ubuntu (WSL2) for native builds (nvcc, headers, libs)
  • Enabling GPU in Docker containers on WSL2 (two options)

Overview

[!IMPORTANT]

@ramsafin
ramsafin / ceres-solver-installation-guide.md
Last active February 24, 2026 12:00
Ceres Solver with CUDA + cuDSS

Ceres Solver with CUDA + cuDSS

A guide to building Ceres Solver with CUDA support and NVIDIA's cuDSS direct sparse solver on WSL2/Ubuntu.

Tested on WSL2 (6.6.87.2-microsoft-standard-WSL2) with Ubuntu 24.04 LTS.

Prerequisites

Before proceeding, verify your GPU setup:

"""
COLMAP converter
- exhaustive matcher
- GPU auto-detection
Tested against:
COLMAP 3.13.0 (CUDA)
"""
from __future__ import annotations

1. Install Miniconda

wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh
~/miniconda3/bin/conda init