This file contains 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 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 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 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 |
This file contains 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
#!/usr/bin/env bash | |
# Check if nvidia-smi is there | |
if ! command -v nvidia-smi &> /dev/null | |
then | |
echo "nvidia-smi could not be found" | |
exit | |
else | |
# Check that it's working |
This file contains 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
#!/usr/bin/env bash | |
# Inspired from https://ostechnix.com/download-packages-dependencies-locally-ubuntu/ | |
# Can be typically run in docker to select the version you want like: | |
# docker run -it -v $(pwd):/host ubuntu:20.04 bash -c "$(cat ./this_script.sh)" | |
package_to_install="docker.io" | |
apt update; apt install -y apt-rdepends lsb-release |
This file contains 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
inline cv::Mat slMat2cvMat(const sl::Mat& input) { | |
int cv_type = -1; | |
switch (input.getDataType()) { | |
case sl::MAT_TYPE::F32_C1: cv_type = CV_32FC1; | |
break; | |
case sl::MAT_TYPE::F32_C2: cv_type = CV_32FC2; | |
break; | |
case sl::MAT_TYPE::F32_C3: cv_type = CV_32FC3; | |
break; | |
case sl::MAT_TYPE::F32_C4: cv_type = CV_32FC4; |
This file contains 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
# https://spin.atomicobject.com/2017/08/24/start-stop-bash-background-process/ | |
trap "kill 0" EXIT | |
# For jetsons | |
if [ "$(arch)" == "aarch64" ]; then | |
nvpmodel_maxn_mode=0 | |
if [ -e "/proc/device-tree/compatible" ]; then | |
if [ -e "/proc/device-tree/model" ]; then |
This file contains 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
sudo apt update -y | |
sudo apt upgrade -y | |
sudo apt dist-upgrade -y | |
sudo apt autoremove -y | |
sudo apt install wget curl nano -y | |
wget https://gist.githubusercontent.com/adujardin/59f7653080c2f25e7558d18de66b59bf/raw/ee6850a5c5b81b936454b3ec6373b127e7181624/upgrade_jetson.sh | |
chmod +x upgrade_jetson.sh | |
sudo bash upgrade_jetson.sh |
This file contains 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
#!/usr/bin/env bash | |
LT4_MAJOR=32 | |
LT4_MINOR_OLD=4 | |
LT4_MINOR=5 | |
if [ "$EUID" -ne 0 ] | |
then echo "Please run as root" | |
exit | |
fi |