Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

smellslikeml smellslikeml

🏠
Working from home
Block or report user

Report or block smellslikeml

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@smellslikeml
smellslikeml / visual_anomaly_detection_demo.py
Created Dec 15, 2019
A simple script to perform webcam visual anomaly detection with autoencoders built with Keras
View visual_anomaly_detection_demo.py
#!/usr/bin/python3
from __future__ import absolute_import, print_function
import cv2
import numpy as np
from time import sleep, time
from collections import deque
from tensorflow.keras.models import Model
from tensorflow.keras.optimizers import RMSprop
from tensorflow.keras.layers import Input, Conv2D, MaxPooling2D, UpSampling2D, ZeroPadding2D
@smellslikeml
smellslikeml / youtube_downloader.py
Created Dec 7, 2019
Download a specific video from YouTube
View youtube_downloader.py
import pytube
def yt_download(video_id, video_path):
video_url = 'https://youtu.be/{}'.format(video_id)
youtube = pytube.YouTube(video_url)
video = youtube.streams.first()
video.download(video_path)
print('youtube video {} saved as: \n\n {}{}.mp4'.format(video_id, video_path, video.title))
@smellslikeml
smellslikeml / lambda_function.py
Created Oct 1, 2019
Lambda function that downloads image classification tflite model + labels, listens to Kinesis stream, and prints predicted labels
View lambda_function.py
from __future__ import print_function
import os
import io
import boto3
import base64
import numpy as np
import zipfile
from PIL import Image
from tflite_runtime.interpreter import Interpreter
@smellslikeml
smellslikeml / anom_droop.ipynb
Created Feb 23, 2019
anomaly detection on droop counts
View anom_droop.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@smellslikeml
smellslikeml / yt_download.py
Last active Dec 11, 2019
download youtube videos to .mp4 with command line argument search string
View yt_download.py
#!/usr/bin/env python
import os
import sys
import requests
from bs4 import BeautifulSoup as bs
from urllib.parse import urlencode
from pytube import YouTube
qstring = sys.argv[1]
out_dir = sys.argv[2]
@smellslikeml
smellslikeml / w2v_tSNE_plot.py
Last active Oct 25, 2018
ntlk, gensim word2vec, sklean t-SNE embedding, matplotlib
View w2v_tSNE_plot.py
#!/usr/bin/python
import sys
import re
import string
from gensim.models import Word2Vec, Phrases
from sklearn.manifold import TSNE
import matplotlib.pyplot as plt
from nltk.corpus import stopwords
from itertools import islice
@smellslikeml
smellslikeml / bte_rssi.py
Created Oct 22, 2018
query for RSSI signal strength with btmgmt
View bte_rssi.py
#!/usr/bin/env python
import subprocess
def rssi_vals(addr):
try:
p = subprocess.Popen('sudo btmgmt find | grep {}'.format(addr), stdout=subprocess.PIPE, shell=True)
a, b = p.communicate()
read_lst = []
for reading in str(a).split('\\n')[:-1]:
View tweepy_streamer.py
#!/usr/bin/env python
import os
import sys
from tweepy import OAuthHandler
from tweepy import Stream
from tweepy.streaming import StreamListener
import json
import socket
consumer_key = os.environ['CONSUMER_KEY']
View tweet_logger.py
#!/usr/bin/env python
import sys
from datetime import datetime
import os
import json
from tweepy import OAuthHandler
from tweepy import Stream
from tweepy.streaming import StreamListener
consumer_key = os.environ['CONSUMER_KEY']
View zipcode_lookup.sh
#!/bin/bash
# zipcode--Given a ZIP code, identifies the city and state. Use city-data.com,
# which has every ZIP code configured as its own web page.
baseURL="http://www.city-data.com/zips"
/bin/echo -n "ZIP code $1 is in "
curl -s -dump "$baseURL/$1.html" | \
grep -i '<title>' | \
cut -d\( -f2 | cut -d\) -f1
exit 0
You can’t perform that action at this time.