Skip to content

Instantly share code, notes, and snippets.

View smellslikeml's full-sized avatar
📈

smellslikeml smellslikeml

📈
View GitHub Profile
@smellslikeml
smellslikeml / video_llama_eval.yaml
Created June 25, 2023 22:38
Video-LLaMA eval config for Colab
model:
arch: video_llama
model_type: pretrain_vicuna
freeze_vit: True
freeze_qformer: True
max_txt_len: 160
end_sym: "###"
low_resource: True
frozen_llama_proj: False
@smellslikeml
smellslikeml / client_example.py
Last active April 19, 2023 03:09
U^2Net Triton Inference Server
import os
import time
import cv2
import hashlib
import numpy as np
from PIL import Image
from absl import logging
import tritonclient.http
@smellslikeml
smellslikeml / marker_viz.py
Created April 23, 2022 14:29
example of visualizing markers
#!/usr/bin/env python3
import sys
import rospy
import rostopic
import numpy as np
import message_filters
import cv2
import numpy as np
from collections import deque
# https://github.com/elliottzheng/face-detection
from face_detection import RetinaFace
# https://pyscenedetect.readthedocs.io/projects/Manual/en/latest/api/scene_manager.html#scenemanager-example
from scenedetect import VideoManager
from scenedetect import SceneManager
# http://index-of.es/Varios-2/Practical%20Python%20AI%20Projects%20Mathemathical%20Models%20of%20Optimization%20Problems%20with%20Google%20OR-Tools.pdf
# coding: utf-8
"""
Example code for solving the transshipment problem. (pg. 111)
Input is an NxN numpy matrix (referenced here as D)
where row N is the demand and column N is the supply for each location 0 through N-1.
To solve, call the solve_model() function with matrix D as the input.
"""
@smellslikeml
smellslikeml / visual_anomaly_detection_demo.py
Created December 15, 2019 19:28
A simple script to perform webcam visual anomaly detection with autoencoders built with Keras
#!/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 December 7, 2019 00:22
Download a specific video from YouTube
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 October 1, 2019 15:58
Lambda function that downloads image classification tflite model + labels, listens to Kinesis stream, and prints predicted labels
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 February 23, 2019 22:52
anomaly detection on droop counts
Loading
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 November 27, 2024 11:29
download youtube videos to .mp4 with command line argument search string
#!/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]