Skip to content

Instantly share code, notes, and snippets.

View icaromag's full-sized avatar

Icaro Magalhaes icaromag

View GitHub Profile
@icaromag
icaromag / install-ivona-sapi-tts.sh
Last active August 29, 2023 20:16
Install the Ivona / SAPI Text To Speech solution
# set the arch [IM]
sudo dpkg --add-architecture i386
# add the repos [IM]
sudo add-apt-repository -y ppa:wine/wine-builds
sudo add-apt-repository -y ppa:ethanak/milena
# update the deps [IM]
sudo apt-get update
sudo apt-get -y upgrade
/*
* @Author: Ícaro Lima Magalhães
*/
#include <iostream>
#include <algorithm>
#include <vector>
#include <fstream>
#include <random>
#include <chrono>
/**
* @Author: Icaro Lima Magalhaes - 2016
*/
#include <algorithm>
#include <iostream>
#include <sstream>
#include <fstream>
#include <utility>
#include <vector>
@icaromag
icaromag / png_cropper.py
Created July 3, 2017 14:53
Snippet used to crop PNG image transparent borders (alpha 0).
from PIL import Image
import numpy as np
from os import listdir
def crop(png_image_name):
pil_image = Image.open(png_image_name)
np_array = np.array(pil_image)
blank_element = [255, 255, 255, 0]
mask = np_array != blank_element
@icaromag
icaromag / png_cropper.py
Created July 3, 2017 14:53
Snippet used to crop PNG image transparent borders (alpha 0).
from PIL import Image
import numpy as np
from os import listdir
def crop(png_image_name):
pil_image = Image.open(png_image_name)
np_array = np.array(pil_image)
blank_element = [255, 255, 255, 0]
mask = np_array != blank_element
from pprint import pprint
from PIL import Image
import numpy as np
import cv2
import os
import io
DATASET_PATH = '/home/icaro/Workspace/classifier/generator-data/perfume/'
INPUT_DIR = '/home/icaro/Workspace/classifier/generator-data/test-inputs/'
INPUT_FILE = INPUT_DIR + './box10.jpg'