- Generate ssh key
# Generate ssh key with files(~/.ssh/id_rsa, ~/.ssh/id_rsa/pub) and username in default
ssh-keygen -t rsa
# Generate ssh key with specified files and username
ssh-keygen -t rsa -f ~/.ssh/[KEY_FILENAME] -C [USERNAME]
When running FastAPI
app, all the logs in console are from Uvicorn
and they do not have timestamp and other useful information. As Uvicorn
applies python logging
module, we can override Uvicorn
logging formatter by applying a new logging configuration.
Meanwhile, it's able to unify the your endpoints logging with the Uvicorn
logging by configuring all of them in the config file log_conf.yaml
.
Before overriding:
uvicorn main:app --reload
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") |
# Show available `presets`
ffmpeg -h encoder=h264_nvenc
""" | |
Serving long-running/heavy-computation task via FastAPI and multiprocessing.Process | |
usage: | |
```sh | |
uvicorn main:app --reload | |
``` | |
""" | |
from fastapi import FastAPI |
""" | |
Serving long-running/heavy-computation task via FastAPI and concurrent.futures.ProcessPoolExecutor | |
usage: | |
```sh | |
uvicorn main:app --reload | |
``` | |
""" | |
from fastapi import FastAPI |
DICOM Processing and Segmentation in Python – Radiology Data Quest Advanced DICOM-CT 3D visualizations with VTK | Kaggle Pulmonary Dicom Preprocessing | Kaggle How to actually to convert 3d numpy array of DICOM images into vtkImageData and vtkAlgorithmOutput? - #2 by dgobbi - Support - VTK
""" | |
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 | |
|
authors: