Skip to content

Instantly share code, notes, and snippets.

View liviaerxin's full-sized avatar

Frank liviaerxin

  • ASTRI
  • Hong Kong
View GitHub Profile
‎‎​
@liviaerxin
liviaerxin / Dicom3dCube.py
Last active May 10, 2023 08:05
DICOM Files Read, 3D Reconstruction and Visualization. #vtk-dicom
"""
DICOM files --> vtk array --> vtk 3D visualization
1. read a series of DICOM files by vtkDICOMImageReader(which will do HU and don't resample)
2. process vtk 3D array with marching cubes algorithm
3. render vtk 3D array
"""
import vtk
from utils import CreateTissue
@liviaerxin
liviaerxin / main.py
Created March 31, 2023 08:44
Serving long-running/heavy-computation task via FastAPI and concurrent.futures.ProcessPoolExecutor #python #fastapi #ml
"""
Serving long-running/heavy-computation task via FastAPI and concurrent.futures.ProcessPoolExecutor
usage:
```sh
uvicorn main:app --reload
```
"""
from fastapi import FastAPI
@liviaerxin
liviaerxin / main.py
Created March 31, 2023 08:21
Serving long-running/heavy-computation task via FastAPI and multiprocessing.Process #python #fastapi #ml
"""
Serving long-running/heavy-computation task via FastAPI and multiprocessing.Process
usage:
```sh
uvicorn main:app --reload
```
"""
from fastapi import FastAPI
@liviaerxin
liviaerxin / multiple_process_queue.py
Created March 8, 2023 08:37
Measure Multiple Process/Thread Queue #python
from multiprocessing import Queue
from multiprocessing import Process
import time
import os
import numpy as np
def put_into_queue(q: Queue):
print(f"PID[{os.getpid()}] put_into_queue")
@liviaerxin
liviaerxin / dlopen_test.c
Last active March 8, 2023 06:56
dlopen_test.c #dlopen
/*!
* clang -Wall -Wextra -o dlopen_test.out dlopen_test.c -ldl
* Usage:
* ./dlopen_test.out ./libOpenCvSharpExtern.dylib
* DYLD_PRINT_LIBRARIES=1 ./dlopen_test.out ./libOpenCvSharpExtern.dylib
*
* linux:
* LD_DEBUG=libs ./binary_name
*/
@liviaerxin
liviaerxin / rest_quick_reference.md
Created September 29, 2017 03:24 — forked from odan/rest_quick_reference.md
REST, RESTful API Quick Reference #api

REST, RESTful API Quick Reference

Ressources

  • Version your API

    • Path: /v1/users
    • Subdomain: api.v1.example.com/users
  • URI must be nouns, not verbs

  • /cars

@liviaerxin
liviaerxin / deep_learning_deployment.md
Last active March 8, 2023 06:52
Deep Learning Deployment #deep-learning

Deep Learning Deployment

Top Deep Learning Server

| Framework | Supported Models | GPU Libraries | | TensorFlow Serving | TensorFlow | cuDNN | | OpenVINO Model Server | TensorFlow, Caffe, ONNX, MXNet | clDNN | | Trtion Inference Server | TensorFlow, TensorRT, ONNX, Caffe2, PyTorch | cuDNN |