Skip to content

Instantly share code, notes, and snippets.

View iraadit's full-sized avatar

Renaud Bouckenooghe iraadit

View GitHub Profile
@iraadit
iraadit / ffmpegtips.txt
Created March 27, 2020 16:56 — forked from rabssm/ffmpegtips.txt
ffmpeg tips
# Interpolate video frames for a higher frame rate
ffmpeg -i source.mp4 -filter:v minterpolate -r 25 result.mp4
ffmpeg -i source.mp4 -vf minterpolate=50,tblend=all_mode=average,framestep=2 result.mp4
# Crop a video to the bottom right quarter
ffmpeg -i in.mp4 -filter:v "crop=in_w/2:in_h/2:in_w/2:in_h/2" -c:a copy out.mp4
# Resize a video to half size
ffmpeg -i input.mkv -filter_complex "scale=in_w/2:in_h/2" output.mkv
@iraadit
iraadit / Makefile
Created June 13, 2019 08:26 — forked from kevinhughes27/Makefile
g++ Makefile for OpenCV Project
CC = g++
CFLAGS = -g -Wall
SRCS = HelloWorld.cpp
PROG = HelloWorld
OPENCV = `pkg-config opencv --cflags --libs`
LIBS = $(OPENCV)
$(PROG):$(SRCS)
$(CC) $(CFLAGS) -o $(PROG) $(SRCS) $(LIBS)
@iraadit
iraadit / export-conda-envs.sh
Created May 3, 2019 11:49
Export all conda environments
#!/bin/bash
NOW=$(date "+%Y-%m-%d")
mkdir $HOME/tmp/envs-$NOW
ENVS=$(conda env list | grep '^\w' | cut -d' ' -f1)
for env in $ENVS; do
source activate $env
conda env export > $HOME/tmp/envs-$NOW/$env.yml
echo "Exporting $env"
done

Bulk Downloading With The Ability to Specify Individual Filenames

After a few hours of searching, I've finally found a convenient way to download a large amount of files in a bulk/multi-threaded/parallel manner, while still having the ability to specify the saved files' names.

Many thanks to Diego Torres Milano

The input file (dl_data.txt):

bird_4345_543.jpg https://example.com/pictures/5351/image.jpg
bird_4345_544.jpg https://example.com/5352/pictures/image.jpg
@iraadit
iraadit / crop_classes.md
Created January 14, 2019 21:10 — forked from vdalv/crop_classes.md
This script reads PascalVOC xml files, and crops the class instances into seperate image files.

Export Class Images from PascalVOC Annotations

This script reads PascalVOC xml files, and crops the class instances into seperate image files.

Note: This script relies on ImageMagick for the crop (convert) functionality. It comes pre-installed on most recent versions of Ubuntu.

Disclaimer: This code is a modified version of Dat Tran's xml_to_csv.py

Example:

Let's say we have this image in our train folder:

Convert PascalVOC Annotations to YOLO

This script reads PascalVOC xml files, and converts them to YOLO txt files.

Note: This script was written and tested on Ubuntu. YMMV on other OS's.

Disclaimer: This code is a modified version of Joseph Redmon's voc_label.py

Instructions:

  1. Place the convert_voc_to_yolo.py file into your data folder.
047d20b52defb3c86ecf1ddf2e84ae8847d18abfde3e3542b4a0a1f11b6f12614778fe3399a95e951ac367c6a9daf56a1cd93880504d47c487a50e1a0f2623c936
@iraadit
iraadit / reinstall.sh
Created February 23, 2018 15:51 — forked from 8enmann/reinstall.sh
Reinstall NVIDIA drivers without opengl Ubuntu 16.04 GTX 1080ti
# Download installers
mkdir ~/Downloads/nvidia
cd ~/Downloads/nvidia
wget https://developer.nvidia.com/compute/cuda/8.0/Prod2/local_installers/cuda_8.0.61_375.26_linux-run
wget http://us.download.nvidia.com/XFree86/Linux-x86_64/384.59/NVIDIA-Linux-x86_64-384.59.run
sudo chmod +x NVIDIA-Linux-x86_64-384.59.run
sudo chmod +x cuda_8.0.61_375.26_linux-run
./cuda_8.0.61_375.26_linux-run -extract=~/Downloads/nvidia/
# Uninstall old stuff
sudo apt-get --purge remove nvidia-*
ffmpeg -i shame-run.mov -r 24/1 test/output%03d.jpg
@iraadit
iraadit / README-Template.md
Created February 22, 2018 14:28 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites