This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This gitlab runner config provide full gpu support for a docker runner (including hw decoding etc) | |
| # Requires gitlab runner >= 13.9 for 'gpus=all', can be 'runtime = "nvidia"' alternatively for older versions (not tested with NVIDIA_DRIVER_CAPABILITIES) | |
| # Some other options may not be required such as 'privileged' but I needed it (for USB device access) | |
| concurrent = 1 | |
| check_interval = 0 | |
| [[runners]] | |
| name = "my_nvidia_runner" | |
| url = <gitlab_url> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| alias make='make -j$(nproc)' | |
| alias m='cmake ..; make -j$(nproc)' | |
| alias c='mkdir -p build; cd build; cmake ..; make -j$(nproc)' | |
| alias b='mkdir -p build; cd build; cmake .. -G Ninja; ninja' | |
| alias magicmerge='git merge -s recursive -Xignore-space-at-eol' | |
| alias gsa='git submodule add ' | |
| alias dock='docker run -it --privileged --gpus all -e NVIDIA_DRIVER_CAPABILITIES=all -v /:/host --network=host -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix ' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This script will setup USB rules to open the ZED cameras without root access | |
| # This can also be useful to access the cameras from a docker container without root (this script needs to be run on the host) | |
| # NB: Running the ZED SDK installer will already setup those | |
| # Print the commands | |
| set -x | |
| # Download the lightest installer | |
| wget -q https://download.stereolabs.com/zedsdk/3.5/jp44/jetsons -O zed_installer.run | |
| # Extracting only the file we're interested in | |
| bash ./zed_installer.run --tar -x './99-slabs.rules' > /dev/null 2>&1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # escape=` | |
| # References: | |
| # https://docs.microsoft.com/en-us/visualstudio/install/build-tools-container?view=vs-2019 | |
| # https://github.com/microsoft/vs-dockerfiles/blob/main/native-desktop/Dockerfile | |
| FROM mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2019 | |
| # Restore the default Windows shell for correct batch processing. | |
| SHELL ["cmd", "/S", "/C"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Goal is to convert this dataset into a mmaction2 friendly one (VideoDataset) | |
| # https://github.com/open-mmlab/mmaction2/blob/master/docs/tutorials/3_new_dataset.md | |
| import os | |
| import random | |
| output="ucf_crimes_custom" | |
| output_ext="_list.txt" | |
| ratio_train=0.8 | |
| output_list=[] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| dest="/foo/bar" | |
| curr="/foo/bar2/" | |
| mkdir "${dest}" | |
| dirs=($(find . -type d)) | |
| for dir in "${dirs[@]}"; do | |
| echo "=========================" | |
| echo $dir | |
| cd "${curr}${dir}" | |
| pwd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Based on https://raw.githubusercontent.com/jkjung-avt/yolov4_crowdhuman/master/data/gen_txts.py | |
| Inputs: | |
| * nothing | |
| * or folder with CrowdHuman_train01.zip, CrowdHuman_train02.zip, CrowdHuman_train03.zip, CrowdHuman_val.zip, annotation_train.odgt, annotation_val.odgt | |
| python crowdhuman_to_yolo.py --dataset_path foo/bar/ | |
| Outputs: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #docker run --gpus=all -it -v /:/host/ nvcr.io/nvidia/pytorch:22.02-py3 | |
| host_folder="/host/tmp/yolov5_results.txt" | |
| rm ${host_folder} | |
| git clone https://github.com/ultralytics/yolov5 | |
| cd yolov5 | |
| pip install -qr requirements.txt | |
| rm requirements.txt | |
| pip uninstall opencv-python | |
| pip install opencv-python-headless==4.4.0.40 ujson |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import cv2 | |
| import numpy as np | |
| disp_u8c4 = cv2.imread("IROS_ORStereo_4K/FoV60/CoalMine/disparity/000002_disp_lu1.png", cv2.IMREAD_UNCHANGED) | |
| disp_gt_f32 = disp_u8c4.view(dtype=np.float32) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ZED_SDK_VERSION="3.5" | |
| URL_base="https://download.stereolabs.com/zedsdk/${ZED_SDK_VERSION}/" | |
| URL_BUCKET="https://stereolabs.sfo2.digitaloceanspaces.com/zedsdk" | |
| #URL_BUCKET="https://stereolabs.sfo2.cdn.digitaloceanspaces.com/zedsdk" | |
| check_HTTP_err_code() { | |
| http_err=$(curl -I -s -o /dev/null -w "%{http_code}" $1) | |
| if [ "$http_err" != "200" ] && [ "$http_err" != "302" ]; then | |
| echo "ERROR: $http_err -> $1" | |
| fi |