Skip to content

Instantly share code, notes, and snippets.

View nanguoyu's full-sized avatar

Dong Wang nanguoyu

View GitHub Profile
git config --global http.proxy 'socks5://192.168.18.17:1082'
git config --global https.proxy 'socks5://192.168.18.17:1082'
git config --global --unset http.proxy
git config --global --unset https.proxy
npm config delete proxy
102367434# 62424314
195174792# 52300345
214769520# 55566133
233322180# 175319345
245326014# 60658881
252694470# 125060579
255360600# 62331313
256660341# 190878113
264324060# 63825223
268186164# 198562001
@nanguoyu
nanguoyu / Ubuntu20.04-cuda11.0-set-up.sh
Last active August 28, 2022 05:09
Ubuntu20.04 CUDA
# Nvidia Driver installation
# sudo apt install nvidia-driver-460
# sudo reboot
# CUDA installation
# Version==11.0.3
# If you want to compile OpenCV with CUDA support,
# please install CUDA11.0.1 by net (method2) and then install CUDA11.0.3 by runfile again and dont override driver.
# Because I find net installtion is different from runfile such as nppi.
@nanguoyu
nanguoyu / setupFFmpegCUDA.sh
Last active April 24, 2021 16:45
Ubuntu FFmpeg with CUDA11.0
git clone https://git.videolan.org/git/ffmpeg/nv-codec-headers.git
cd nv-codec-headers && make && sudo make install
git clone https://github.com/FFmpeg/FFmpeg.git
cd FFmpeg
# Manually modify nvccflags_default
./configure --enable-nonfree \
--enable-cuda-nvcc \
--enable-libnpp \
--enable-pic \
@nanguoyu
nanguoyu / coco.sh
Last active February 9, 2021 20:57 — forked from mkocabas/coco.sh
Download COCO dataset. Run under 'datasets' directory.
mkdir coco
cd coco
mkdir images
cd images
wget -c http://images.cocodataset.org/zips/train2017.zip
wget -c http://images.cocodataset.org/zips/val2017.zip
wget -c http://images.cocodataset.org/zips/test2017.zip
wget -c http://images.cocodataset.org/zips/unlabeled2017.zip
@nanguoyu
nanguoyu / OpenCV_GPU.sh
Last active March 4, 2021 23:51
Install OpenCV with GPU support
sudo apt-get install qt5-default
sudo apt-get install opencl-headers
sudo pip install pylint
# Install minimal prerequisites (Ubuntu 18.04 as reference)
sudo apt update && sudo apt install -y cmake g++ wget unzip
# Download and unpack sources
wget -O opencv.zip https://github.com/opencv/opencv/archive/master.zip
wget -O opencv_contrib.zip https://github.com/opencv/opencv_contrib/archive/master.zip
unzip opencv.zip
unzip opencv_contrib.zip
@nanguoyu
nanguoyu / Ubuntu18.04 Python3.8
Last active June 6, 2021 21:03
Install Python3.8 in Ubutun18.04 from source
apt-get update && apt-get upgrade -y &&\
apt-get install -y wget \
build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev
wget https://www.python.org/ftp/python/3.8.0/Python-3.8.0.tgz &&\
tar -xf Python-3.8.0.tgz &&\
cd Python-3.8.0 &&\
./configure --enable-optimizations &&\
make -j8 &&\
git clone https://github.com/nanguoyu/GenoCAE.git
cd GenoCAE/
docker build -t gcae/genocae:build -f docker/build.dockerfile .
docker run -it --rm -v ${PWD}:/workspace gcae/genocae:build python3 run_gcae.py --help
@nanguoyu
nanguoyu / 3D_Beta_Space.py
Last active December 12, 2022 10:24
3D Beta space
hyper_output = []
with tqdm(range(-180, 181, 10), position=0) as t:
for x in t:
for y in tqdm(range(-180, 181, 10), disable=True):
for z in tqdm(range(-180, 181, 10), disable=True):
angles = torch.tensor([x,y,z])/180*torch.pi
Hyper_x = transform_angles(angles=angles).to(device=gpu_computation)
hyper_output.append(model.hyper_stack(Hyper_x).cpu().detach().numpy())