Skip to content

Instantly share code, notes, and snippets.

View iCUE-Solutions's full-sized avatar

dliebich iCUE-Solutions

View GitHub Profile
@lanzani
lanzani / mediapipe_multiple_person.py
Last active April 15, 2024 03:24
Use mediapipe to find multiple person 3d keypoints
import cv2
import numpy as np
import mediapipe as mp
from mediapipe.tasks import python
from mediapipe.tasks.python import vision
from mediapipe.framework.formats import landmark_pb2
# Model available to download here: https://developers.google.com/mediapipe/solutions/vision/pose_landmarker#models
model_path = "pose_landmarker_full.task"
@iCUE-Solutions
iCUE-Solutions / video-subtitles-via-whisper.py
Created September 19, 2023 21:14 — forked from rasbt/video-subtitles-via-whisper.py
Script that creates subtitles (closed captions) for all MP4 video files in your current directory
# Sebastian Raschka 09/24/2022
# Create a new conda environment and packages
# conda create -n whisper python=3.9
# conda activate whisper
# conda install mlxtend -c conda-forge
# Install ffmpeg
# macOS & homebrew
# brew install ffmpeg
# Ubuntu
@VictorTaelin
VictorTaelin / gpt4_abbreviations.md
Last active June 18, 2024 15:03
Notes on the GPT-4 abbreviations tweet

Notes on this tweet.

  • The screenshots were taken on different sessions.

  • The entire sessions are included on the screenshots.

  • I lost the original prompts, so I had to reconstruct them, and still managed to reproduce.

  • The "compressed" version is actually longer! Emojis and abbreviations use more tokens than common words.

@wiseman
wiseman / agent.py
Last active March 30, 2024 12:51
Langchain example: self-debugging
from io import StringIO
import sys
from typing import Dict, Optional
from langchain.agents import load_tools
from langchain.agents import initialize_agent
from langchain.agents.tools import Tool
from langchain.llms import OpenAI
@rasbt
rasbt / video-subtitles-via-whisper.py
Last active September 19, 2023 21:14
Script that creates subtitles (closed captions) for all MP4 video files in your current directory
# Sebastian Raschka 09/24/2022
# Create a new conda environment and packages
# conda create -n whisper python=3.9
# conda activate whisper
# conda install mlxtend -c conda-forge
# Install ffmpeg
# macOS & homebrew
# brew install ffmpeg
# Ubuntu
@schaumb
schaumb / redirect.py
Last active December 29, 2023 02:16
streamlit redirect
import streamlit as st
import io
import contextlib
import sys
import re
import threading
class _Redirect:
class IOStuff(io.StringIO):
@ESWZY
ESWZY / compress_video.py
Last active May 9, 2024 17:48
An example Python code for compressing video file to target size.
# Simplified version and explanation at: https://stackoverflow.com/a/64439347/12866353
import os
import ffmpeg
def compress_video(video_full_path, size_upper_bound, two_pass=True, filename_suffix='cps_'):
"""
Compress video file to max-supported size.
:param video_full_path: the video you want to compress.
:param size_upper_bound: Max video size in KB.
@fedarko
fedarko / gh_url_to_raw_gh_url.py
Created October 2, 2019 22:10
Convert a github file URL to a raw.githubusercontent.com URL (that can be directly accessed for things like view.qiime2.org or wget)
# your link goes here
link = "https://github.com/knightlab-analyses/qurro-mackerel-analysis/blob/master/AnalysisOutput/qurro-plot.qzv"
# note: this will break if a repo/organization or subfolder is named "blob" -- would be ideal to use a fancy regex
# to be more precise here
print(link.replace("github.com", "raw.githubusercontent.com").replace("/blob/", "/"))
# example output link:
# https://raw.githubusercontent.com/knightlab-analyses/qurro-mackerel-analysis/master/AnalysisOutput/qurro-plot.qzv
@benhoyle
benhoyle / Building AV Capture Objects.ipynb
Last active March 4, 2024 07:07
Building Audio/Video Capture Objects
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@MuhsinFatih
MuhsinFatih / fix-macos-python.md
Last active June 26, 2024 05:52
How to recover from messed up python installation on mac, and never have to mess with apple's shitty python confusion factory

I am assuming you are here because like me, you installed a bazillion different python interpreters on mac and the whole thing is a spagetti. Today, I finally fixed my python installation. Whatever I install for python2 or python3 using pip JUST.WORKS.. My god! finally.

What the hell?

Here is what I had messed up, which you also probably did:

  • I had too many different python interpreters
  • Too many different symlinks which I lost track of
  • almost no package I installed with pip worked without a headache
  • any attempt to fix using online resources made it worse.