Skip to content

Instantly share code, notes, and snippets.

View mcarletti's full-sized avatar

Marco Carletti mcarletti

View GitHub Profile
@mcarletti
mcarletti / cuda_9.0_on_ubuntu_18.04.sh
Last active July 12, 2019 13:53 — forked from Mahedi-61/cuda_11.8_installation_on_Ubuntu_22.04
cuda 9.0 complete installation procedure for ubuntu 18.04 LTS
#!/bin/bash
## This gist contains step by step instructions to install cuda v9.0 and cudnn 7.2 in ubuntu 18.04
### steps ####
# verify the system has a cuda-capable gpu
# download and install the nvidia cuda toolkit and cudnn
# setup environmental variables
# verify the installation
###
@mcarletti
mcarletti / uninstall_cuda_and_nvidia_drivers.sh
Last active June 21, 2019 16:49
Uninstall CUDA, NVIDIA drivers and utilities on Ubuntu (18.04)
#!/bin/bash
sudo apt remove --purge -y 'cuda*' 'nvidia-*'
sudo add-apt-repository --remove -y ppa:graphics-drivers/ppa
sudo apt update
sudo reboot
@mcarletti
mcarletti / cuda_10.0_on_ubuntu_18.04.sh
Last active October 30, 2019 11:30
cuda 10.0 installation on ubuntu 18.04 LTS
#!/bin/bash
#
# Install CUDA 10.0 on a "fresh" Ubuntu 18.04 LTS machine.
#
# update: July 2019
# author: Marco Carletti
#
# Deep Learning frameworks requirements:
# PyTorch 1.1.0 -- CUDA 10.x
# TensorFlow-pgu 1.13.x or higher -- CUDA 10.0, cuDNN 7.3
@mcarletti
mcarletti / ubuntu_setup.sh
Last active May 4, 2023 13:26
Setup Ubuntu after fresh install.
#!/bin/sh
if [[ $(/usr/bin/id -u) -ne 0 ]]; then
echo "Not running as root"
exit 1
fi
apt update
apt upgrade -y
@mcarletti
mcarletti / opera_x264_support.sh
Last active March 11, 2024 08:23
Enable H.264 codec support for Opera browser
#!/bin/bash
# Author: Marco Carletti
# Date: May 2022
# Version: 0.2.0
# Last update: July 17, 2023
# Changed comments, tested versions and added other distros info, such as Debian and Fedora.
# Thanks to everyone for comments, suggestions, fixes and testings!
@mcarletti
mcarletti / pvnet.sh
Last active September 24, 2019 09:28
Download, compile and install PVNet
#!/bin/bash
sudo apt update
# Tested on:
# ubuntu 18.04 (kernel 4.15.0-58-generic x86_64 GNU/Linux)
# gcc (Ubuntu 5.5.0-12ubuntu1) 5.5.0 20171010
# cuda 8.0 (/usr/local/cuda-8.0)
git clone https://github.com/zju3dv/pvnet.git
@mcarletti
mcarletti / example.desktop
Last active August 27, 2020 12:49
Minimal description and example of a Ubuntu launcher file, aka .desktop file
[Desktop Entry]
Name=Name of Application
GenericName=Application
GenericName[it]=Applicazione
Comment=Cool app, very useful
Comment[it]=Applicazione molto utile e intrigante
Categories=cat1;cat2;...
Keywords=kw1;kw2;...
Encoding=UTF-8
Exec=/path/to/executable
@mcarletti
mcarletti / CMakeLists.txt
Last active October 17, 2019 09:07
Simple cmake file (comments in ITA)
# ========================================================
# Assumo che la struttura del progetto sia la seguente:
#
# .
# ├── include
# │  └── engine
# │  └── ...
# ├── sources
# │  └── ...
# ├── examples
@mcarletti
mcarletti / create_wordcloud.py
Last active March 7, 2024 11:35
Parse main CVF conference titles and abstracts (eg, CVPR, ICCV)
import sys
import numpy as np
import matplotlib.pyplot as plt
from wordcloud import WordCloud
filename = sys.argv[1]
print(filename)
text = open(filename, "r").read()
@mcarletti
mcarletti / cvutils.cpp
Last active February 8, 2024 15:43
Set of Qt / OpenCV snippets
/*
* Convert a cv::Mat frame to a QPixmap and show it in a Qt object.
*
* Parameters
* ----------
* frame : cv::Mat
* Input image in BGR format.
*/
void updateImageFrameToQLabel(cv::Mat& frame)
{