This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#define KNRM "\x1B[0m" | |
#define KRED "\x1B[31m" | |
#define KGRN "\x1B[32m" | |
#define KYEL "\x1B[33m" | |
#define KBLU "\x1B[34m" | |
#define KMAG "\x1B[35m" | |
#define KCYN "\x1B[36m" | |
#define KWHT "\x1B[37m" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
def normalize_to_smallest_integers(labels): | |
"""Normalizes a list of integers so that each number is reduced to the minimum possible integer, maintaining the order of elements. | |
:param labels: the list to be normalized | |
:returns: a numpy.array with the values normalized as the minimum integers between 0 and the maximum possible value. | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def gera_amostras(dados, k_vizinhos=5, k_amostras=5): | |
""" | |
Simples gerador de amostras sintéticas a partir de distâncias. A partir de duas | |
amostras P e Q do conjunto de k_amostras, gera uma terceira R igual ao ponto médido | |
de P e Q. | |
Requisitos: numpy scikit-learn. | |
Parâmetros | |
---------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# camlist.py | |
# Lists all avaiable cameras attached to the computer | |
# Dependencies: pip install opencv-python | |
# Usage: python camlist.py | |
import cv2 | |
print(f"OpenCV version: {cv2.__version__}") | |
max_cameras = 10 |