Skip to content

Instantly share code, notes, and snippets.

@priteshgohil
priteshgohil / images2pdf.sh
Last active January 8, 2021 22:41
Convert all images in directory to pdf file and produce compressed pdf file using ghostscript. Most suitable for image compression without loosing much of information.
#!/bin/bash
#title :images2pdf.sh
#description :Best image compression ever.
#author :Pritesh Gohil
#date :08 Jan 2021
#version :0.1
#usage :bash images2pdf.sh -i ../Desktop/img_dir/
#notes :Install ImageMagick and ghostscript packages.
#bash_version :5.0.16(1)-release
@priteshgohil
priteshgohil / video2frames_cv.py
Last active November 4, 2023 18:56
Extract frames from video using OpenCV
#!/usr/bin/env python
"""
Author: Pritesh Gohil
Import or run this script to extract frames from a single video or
video directory using OpenCV
Requirement: numpy, cv2, tqdm
How to use:
Single Video
@dusty-nv
dusty-nv / pytorch_jetson_install.sh
Last active October 21, 2021 01:28
Install procedure for pyTorch on NVIDIA Jetson TX1/TX2 with JetPack <= 3.2.1. For JetPack 4.2 and Xavier/Nano/TX2, see https://devtalk.nvidia.com/default/topic/1049071/jetson-nano/pytorch-for-jetson-nano/
#!/bin/bash
#
# EDIT: this script is outdated, please see https://forums.developer.nvidia.com/t/pytorch-for-jetson-nano-version-1-6-0-now-available
#
sudo apt-get install python-pip
# upgrade pip
pip install -U pip
pip --version
# pip 9.0.1 from /home/ubuntu/.local/lib/python2.7/site-packages (python 2.7)
@wngreene
wngreene / bag_to_images.py
Last active June 29, 2024 10:18
Extract images from a rosbag.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2016 Massachusetts Institute of Technology
"""Extract images from a rosbag.
"""
import os
import argparse