Skip to content

Instantly share code, notes, and snippets.

View Alyetama's full-sized avatar
🏠
Working from home

Mohammad Alyetama Alyetama

🏠
Working from home
View GitHub Profile
@Alyetama
Alyetama / color.md
Last active April 28, 2022 13:20 — forked from minism/color.py
python terminal colors

Terminal color definitions

FOREGROUND

BLACK   = \033[30m
RED     = \033[31m
GREEN   = \033[32m
YELLOW  = \033[33m
BLUE    = \033[34m
MAGENTA = \033[35m
r"""
# SOURCE: https://github.com/microsoft/CameraTraps/blob/main/detection/run_tf_detector.py
# EDITED TO WORK WITH SHARED GPUs
#-----------------------------------------------------------------------------
Module to run a TensorFlow animal detection model on images.
The class TFDetector contains functions to load a TensorFlow detection model and
run inference. The main function in this script also renders the predicted
bounding boxes on images and saves the resulting images (with bounding boxes).
@Alyetama
Alyetama / run_ffmpeg_on_gpu.sh
Last active February 11, 2022 14:40
Install NVIDIA video codec SDK for ffmpeg
#!/bin/sh
# Check if this CUDA version is compatibile with your setup before running. If not, replace the links accordingly
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin
sudo mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600
wget https://developer.download.nvidia.com/compute/cuda/11.6.0/local_installers/cuda-repo-ubuntu2004-11-6-local_11.6.0-510.39.01-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu2004-11-6-local_11.6.0-510.39.01-1_amd64.deb
sudo apt-key add /var/cuda-repo-ubuntu2004-11-6-local/7fa2af80.pub
sudo apt-get update
sudo apt-get -y install cuda
#!/bin/bash
printf "Github email? "
read -r github_email
printf "Github username? "
read -r github_username
#-----------------------------------------------------------------------------
sudo apt update
#-----------------------------------------------------------------------------
curl https://getcroc.schollz.com | bash
@Alyetama
Alyetama / install_chromedriver_ubuntu.sh
Last active January 19, 2022 16:17
Install latest Chromedriver on Ubuntu
#!/bin/bash
sudo curl -sS -o - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add
sudo bash -c "echo 'deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main' >> /etc/apt/sources.list.d/google-chrome.list"
sudo apt update && sudo apt install unzip google-chrome-stable -y
LATEST_RELEASE=$(curl -s https://chromedriver.storage.googleapis.com/LATEST_RELEASE)
wget https://chromedriver.storage.googleapis.com/$LATEST_RELEASE/chromedriver_linux64.zip
unzip chromedriver_linux64.zip && rm chromedriver_linux64.zip
Bootstrap: docker
From: python:3
%post
pip install imageio
pip install imageio-ffmpeg
Bootstrap: docker
From: bethgelab/deeplearning:cuda9.0-cudnn7