Skip to content

Instantly share code, notes, and snippets.

View gustavz's full-sized avatar
💭
All I know is that i know nothing. And even with that, I'm not sure.

Gustav von Zitzewitz gustavz

💭
All I know is that i know nothing. And even with that, I'm not sure.
View GitHub Profile
@gustavz
gustavz / list_deeplake_datasets.py
Last active July 26, 2023 07:25
List all available Deep Lake cloud datasets for a given user / orgnaization.
from deeplake.util.bugout_reporter import deeplake_reporter
from deeplake.client.client import DeepLakeBackendClient
def list_deeplake_datasets(
org_id: str = "",
token: str = None,
) -> None:
"""List all available Deep Lake cloud datasets.
Removed from deeplake in: https://github.com/activeloopai/deeplake/pull/2182/files
"""
@chad-m
chad-m / streamlit_download_button.py
Last active November 25, 2024 14:38
A download function and examples app for Streamlit
import base64
import os
import json
import pickle
import uuid
import re
import streamlit as st
import pandas as pd
@pavlin-policar
pavlin-policar / max_heap.py
Created November 22, 2018 11:11
Python implementation of max heap/priority queue
class MaxHeap:
def __init__(self, collection=None):
self._heap = []
if collection is not None:
for el in collection:
self.push(el)
def push(self, value):
self._heap.append(value)
@jkjung-avt
jkjung-avt / tegra-cam-rec.py
Last active August 20, 2021 03:10
A Tegra X2/X1 camera recorder, implemented in python
# --------------------------------------------------------
# Camera Recorder for Tegra X2/X1
#
# This program captures video from IP CAM, USB webcam,
# or the Tegra onboard camera, adds some watermark on
# the video frames and then records it into a TS file.
# The code demonstrates how to use cv2.VideoWriter()
# while taking advantage of TX2/TX1's H.264 H/W encoder
# capabilities.
#
@tarlen5
tarlen5 / calculate_mean_ap.py
Last active November 6, 2024 19:45
Calculate mean Average Precision (mAP) for a set of ground truth and predicted bounding boxes for a set of images.
"""
author: Timothy C. Arlen
date: 28 Feb 2018
Calculate Mean Average Precision (mAP) for a set of bounding boxes corresponding to specific
image Ids. Usage:
> python calculate_mean_ap.py
Will display a plot of precision vs recall curves at 10 distinct IoU thresholds as well as output
@salilkapur
salilkapur / mat_to_pascal.py
Created June 9, 2017 20:04
Script to convert mat annotations to PASCAL like annotations
'''
This file converts the hand dataset (https://www.robots.ox.ac.uk/~vgg/data/hands/) to Pascal Format
'''
import scipy.io as sio
from os import listdir
from os.path import isfile, join
import math
from xml.etree import ElementTree as et
import cv2
@patik
patik / how-to-squash-commits-in-git.md
Last active May 30, 2024 07:59
How to squash commits in git

Squashing Git Commits

The easy and flexible way

This method avoids merge conflicts if you have periodically pulled master into your branch. It also gives you the opportunity to squash into more than 1 commit, or to re-arrange your code into completely different commits (e.g. if you ended up working on three different features but the commits were not consecutive).

Note: You cannot use this method if you intend to open a pull request to merge your feature branch. This method requires committing directly to master.

Switch to the master branch and make sure you are up to date:

@PurpleBooth
PurpleBooth / README-Template.md
Last active December 12, 2024 13:51
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@bsweger
bsweger / useful_pandas_snippets.md
Last active November 28, 2024 12:44
Useful Pandas Snippets

Useful Pandas Snippets

A personal diary of DataFrame munging over the years.

Data Types and Conversion

Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)