Category: 未分类

3 Posts

NVIDIA Xavier Depolyment: ONNXRuntime and TensorRT
Installation Virtual Environment - archiconda Install the archiconda environment at terminal wget https://github.com/Archiconda/build-tools/releases/download/0.2.3/Archiconda3-0.2.3-Linux-aarch64.sh sh Archiconda3-0.2.3-Linux-aarch64.sh Reference: https://blog.csdn.net/qq_40691868/article/details/114362278?spm=1001.2014.3001.5501 [Not Nesessary] In order to enter the system path environment when enter the terminal. It needs to comment the code "conda activate base" in ".bashrc" # added by Archiconda3 0.2.3 installer # >>> conda init >>> # !! Contents within this block are managed by 'conda init' !! __conda_setup="$(CONDA_REPORT_ERRORS=false '/home/jetson/archiconda3/bin/conda' shell.bash hook 2> /dev/null)" if [ $? -eq 0 ]; then \eval "$__conda_setup" else if [ -f "/home/jetson/archiconda3/etc/profile.d/conda.sh" ]; then . "/home/jetson/archiconda3/etc/profile.d/conda.sh" CONDA_CHANGEPS1=false #conda activate base else \export PATH="/home/jetson/archiconda3/bin:$PATH" fi fi unset __conda_setup # <<< conda init <<< create a new environment It better to keep the python version consistent with the system. conda create --name mytest python=3.6.9 conda activate mytest Connect the prebuild packages to the virtual environment (useless, need further verification) Enter the python interactive command, there is no opencv package. It needs to allows the conda environment to be reintroduced to the global/user site packages. Enter the virtual environment through export PYTHONNOUSERSITE=0 conda activate <YOUR_ENVIROMENT>…
Cheat Sheet of Ubuntu
TODO This post contains the solutions to some common bugs occured in deep learning with Ubuntu. It contains: Basic usage of Ubuntu CUDA Ubuntu Add/delete user # add a new user NEW_USER_NAME sudo adduser -m NEW_USER_NAME # set password sudo pass NEW_USER_NAME # delete a user sudo deluser NEW_USER_NAME # Fix a bug: if the console of the new user does # NOT display current directory OR only display $ # OR cannot use most of the shell command # It means the path "bin" is not connected correctly # delete the user and add it through: useradd -s /bin/bash -d /home/xxx -m xxx Install CUDA Install CUDA 10.2 To use CUDA 10.2 as an example, the official instruction is like: from https://developer.nvidia.com/cuda-10.2-download-archive?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1804&target_type=runfilelocal Command: # for ubuntu 20.04, it needs to install GCC 8 # the maximum support version of CUDA 10.2 is GCC 8, # Install GCC 8, and switch system GCC version to GCC 8 sudo apt-get install gcc-8 g++-8 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 800 --slave /usr/bin/g++ g++ /usr/bin/g++-8 # download…
Cheat Sheet of OpenCV
TODO in progress Image Related TODO Video Related Basic video reading video_file = "path/to/video/file.mp4" cap = cv2.VideoCapture(video_file) fps = cap.get(cv2.CAP_PROP_FPS) length = cap.get(cv2.CAP_PROP_FRAME_COUNT) print("Video File %s ==> fps: %.2f, total: %d frames" % (video_file, fps, length)) video_start = int(0) # start from index 0 video_end = video_start + 50000 # read the first 50000 frames cap.set(1, video_start) for frame_index in range(video_start, video_end): ret, frame = cap.read() if not ret: break cv2.putText(frame, "Frame:" + str(frame_index), (20, 100), cv2.FONT_HERSHEY_SIMPLEX, 1, (255,255,255), 2) cv2.imshow("frame", frame) cv2.waitKey(0) Reading with Specific Index example: read every 5s video_file = "path/to/video/file.mp4'" cap = cv2.VideoCapture(video_file) fps = cap.get(cv2.CAP_PROP_FPS) length = cap.get(cv2.CAP_PROP_FRAME_COUNT) print("Video File %s ==> fps: %.2f, total: %d frames" % (video_file, fps, length)) video_start = int(0) # start from index 0 video_end = video_start + 50000 # read the first 50000 frames cap.set(1, video_start) for frame_index in range(video_start, video_end): if not frame_index%int(5*fps)==0: continue else: cap.set(1, frame_index) ret, frame = cap.read() if not ret: break cv2.putText(frame, "Frame:" + str(frame_index), (20, 100), cv2.FONT_HERSHEY_SIMPLEX, 1, (255,255,255), 2) cv2.imshow("frame", frame) cv2.waitKey(0) Convert a Video File to…