Skip to content

Instantly share code, notes, and snippets.

@ZFTurbo
ZFTurbo / moises_to_musdb18.py
Last active November 11, 2024 14:21
Moises to MUSDB18
import os
import soundfile as sf
import numpy as np
from tqdm import tqdm
import glob
import operator
def combine_audio_files(files: list[str], prefered_length: int) -> tuple[np.ndarray, int]:
"""
@ZFTurbo
ZFTurbo / pycuda_resize.py
Created June 11, 2024 13:28
PyCuda image resize
# coding: utf-8
__author__ = 'ZFTurbo: https://github.com/ZFTurbo/'
if __name__ == '__main__':
import os
gpu_use = "0"
print('GPU use: {}'.format(gpu_use))
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"] = "{}".format(gpu_use)
@ZFTurbo
ZFTurbo / dicom_2_png.py
Created March 9, 2024 15:30
DICOM to PNG Converter
# coding: utf-8
__author__ = 'ZFTurbo: https://github.com/ZFTurbo/'
import os
import glob
import cv2
import pydicom
import argparse
def convert_dataset(args):