Skip to content

Instantly share code, notes, and snippets.

Avatar

WittmannF

View GitHub Profile
View instalar_anaconda.md
View hello.py
import re
PATTERN = '(.*), (.*) - (.*): [bB]om dia'
db = re.findall(PATTERN, txt)
View face_recognition.md

Face Recognition in Python with the OpenCV Library

In this post we will use the OpenCV library for facial recognition. Here is an example using my webcam as an input:

The best part is that it can be done using less than 20 lines of code:

View solucao-ashrae-kaggle.py
## Imports
from ashrae_utils import reduce_mem_usage, CyclicLR, LRFinder
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
import math
import tqdm
import gc
from sklearn.linear_model import RidgeCV
import seaborn as sns
@WittmannF
WittmannF / bi-wp-familia.ipynb
Last active Jun 1, 2020
BI-wp-familia.ipynb
View bi-wp-familia.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@WittmannF
WittmannF / take-element-screenshot-selenium.py
Last active Jan 10, 2020
Function for taking a screenshot of an element using selenium
View take-element-screenshot-selenium.py
from selenium import webdriver
from PIL import Image
from io import BytesIO
def take_screenshot(element, driver, filename='screenshot.png'):
"""
Source: https://stackoverflow.com/questions/15018372/how-to-take-partial-screenshot-with-selenium-webdriver-in-python
"""
location = element.location_once_scrolled_into_view
size = element.size
View bi-wp-familia.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@WittmannF
WittmannF / lr_finder_keras.py
Last active May 11, 2020
Learning Rate Finder as a Keras Callback
View lr_finder_keras.py
from keras.callbacks import Callback
import keras.backend as K
import numpy as np
import matplotlib.pyplot as plt
class LRFinder(Callback):
"""
Up-to date version: https://github.com/WittmannF/LRFinder
Example of usage:
from keras.models import Sequential
@WittmannF
WittmannF / lr_finder.py
Last active May 30, 2019 — forked from jeremyjordan/lr_finder.py
Keras Callback for finding the optimal range of learning rates
View lr_finder.py
import matplotlib.pyplot as plt
import keras.backend as K
from keras.callbacks import Callback
class LRFinder(Callback):
'''
A simple callback for finding the optimal learning rate range for your model + dataset.
You can’t perform that action at this time.