Skip to content

Instantly share code, notes, and snippets.

View pangyuteng's full-sized avatar

pangyuteng

View GitHub Profile
@pangyuteng
pangyuteng / .gitignore
Last active February 8, 2025 00:31
SimpleITK image read and write
.env
*.nii.gz
tmp
@pangyuteng
pangyuteng / README.md
Last active June 3, 2024 22:06
report (image,text) generation in python using jinja2,html,wkhtmltopdf via imgkit


docker run -it -u $(id -u):$(id -g) -w $PWD -v /mnt:/mnt pangyuteng/dcm:latest bash

apt-get install wkhtmltopdf
pip install imgkit,pdfkit,jinja2
@pangyuteng
pangyuteng / test_tfrecords.py
Last active January 22, 2019 05:16
profiling loading of multiple tfrecords versus one tfrecords
import sys,os
import tensorflow as tf
import numpy as np
from tensorflow.python.estimator.model_fn import ModeKeys as Modes
tf.logging.set_verbosity(tf.logging.INFO)
w = 512
h = 512
d = 300
c = 11
@pangyuteng
pangyuteng / README.md
Last active October 3, 2024 16:46
triggering of http dag jobs with asyncio and aiohttp

Sample code to run DAG jobs with python asyncio and aiohttp libraries.

example DAG

    D______
A _/  C    \
   \_/ \_E__\_F
     \ /

B

@pangyuteng
pangyuteng / data-source-abstraction-layer.md
Last active October 23, 2019 05:29
work-in-progress data source abstraction architecture/design pattern

work-in-progress data source abstraction architecture/design pattern

#### Data source abtraction layer

class FileStore
    def write
    def read
    def remove
@pangyuteng
pangyuteng / readme.md
Created May 21, 2019 04:09
cvat share - via mount

use the share option in CVAT per davidblom cvat-ai/cvat#203

update CVAT docker-compose.yml to follow the below, where /home/david/shared_data is the local share.

version: "2.3"

services:
  cvat:
 volumes:
@pangyuteng
pangyuteng / Dockerfile
Last active September 25, 2024 16:52
docker miniconda ubuntu
#
# ref https://github.com/tebeka/pythonwise/blob/master/docker-miniconda/Dockerfile
#
# miniconda vers: http://repo.continuum.io/miniconda
# sample variations:
# Miniconda3-latest-Linux-armv7l.sh
# Miniconda3-latest-Linux-x86_64.sh
# Miniconda3-py38_4.10.3-Linux-x86_64.sh
# Miniconda3-py37_4.10.3-Linux-x86_64.sh
#
@pangyuteng
pangyuteng / jinja2_file_less.py
Created June 25, 2019 16:26 — forked from wrunk/jinja2_file_less.py
python jinja2 examples
#!/usr/bin/env/python
#
# More of a reference of using jinaj2 without actual template files.
# This is great for a simple output transformation to standard out.
#
# Of course you will need to "sudo pip install jinja2" first!
#
# I like to refer to the following to remember how to use jinja2 :)
# http://jinja.pocoo.org/docs/templates/
#
@pangyuteng
pangyuteng / CMakeLists.txt
Last active July 12, 2019 21:30 — forked from ndevenish/CMakeLists.txt
Very simple "Getting started" boost-python CMakeLists.txt - added Dockerfile
cmake_minimum_required(VERSION 3.5)
# Find python and Boost - both are required dependencies
find_package(PythonLibs 2.7 REQUIRED)
find_package(Boost COMPONENTS python REQUIRED)
# Without this, any build libraries automatically have names "lib{x}.so"
set(CMAKE_SHARED_MODULE_PREFIX "")
# Add a shared module - modules are intended to be imported at runtime.
@pangyuteng
pangyuteng / CMakeLists.txt
Last active November 1, 2024 08:42
Sample code to build a cython module via Scikit Build; Dockfile also contains instructions for building ITK VTK Boost (with Python 3.7 via Conda) Zlib with CMake in Ubuntu.
cmake_minimum_required(VERSION 3.5)
project(_hello)
# Find python and Boost - both are required dependencies
find_package(PythonLibs REQUIRED)
find_package(PythonInterp REQUIRED)
find_package(PythonExtensions REQUIRED)
find_package(Cython REQUIRED)
find_package(ZLIB REQUIRED)