Skip to content

Instantly share code, notes, and snippets.

View ggand0's full-sized avatar
💭
getting shit done

Gota Gando ggand0

💭
getting shit done
View GitHub Profile
@syuji-higa
syuji-higa / .env.develop
Last active December 26, 2021 06:32
Nuxt.js - env module for axios
API_BASE_URL=http://localhost:8000
@pinkerltm
pinkerltm / ResNet50_BO.py
Created May 29, 2019 08:18
My approach on using Ax/BoTorch to optimize a CNN for Traffic Sign classification
#######################################################
## this code was used in a Jupyter notebook
## therefore some jupyter specific lines are commented out
#%matplotlib inline
#%config InlineBackend.figure_format = 'retina'
import matplotlib.pyplot as plt
import numpy as np
import torch
@sadimanna
sadimanna / clahe.py
Last active May 14, 2025 08:04
Contrast Limited Adaptive Histogram Equalization in Python
'''
"Contrast Limited Adaptive Histogram Equalization"
by Karel Zuiderveld, karel@cv.ruu.nl
in "Graphics Gems IV", Academic Press, 1994
_Author_ -- Siladittya Manna
The below implementation does not assume that the
X- and Y image resolutions are an integer multiple
of the X- and Y sizes of the contextual regions.
@zongfan2
zongfan2 / asynchronous_caching_video_stream.py
Last active July 17, 2024 22:46
Asynchronous caching and analysis of video stream with opencv and multithreading
import cv2
from redis import ConnectionPool, Redis
import numpy as np
import json, time
from multithreading import Thread, Event
redis_config = {"server": "localhost",
"passwd": '',
"port": '6379',
"db": 0}
@hysts
hysts / extract_scalars.py
Last active November 6, 2020 13:51
Extract scalars from Tensorboard log
#!/usr/bin/env python
import argparse
import json
import pathlib
from tensorboard.backend.event_processing import event_accumulator
def main():
parser = argparse.ArgumentParser()
@illume
illume / flask_matplotlib.py
Last active September 21, 2022 02:14
Shows how to use flask and matplotlib together.
""" Shows how to use flask and matplotlib together.
Shows SVG, and png.
The SVG is easier to style with CSS, and hook JS events to in browser.
python3 -m venv venv
. ./venv/bin/activate
pip install flask matplotlib
python flask_matplotlib.py
"""
@stefanonardo
stefanonardo / early_stopping.py
Last active February 28, 2024 19:21
Early Stopping PyTorch
# MIT License
#
# Copyright (c) 2018 Stefano Nardo https://gist.github.com/stefanonardo
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@mkocabas
mkocabas / coco.sh
Created April 9, 2018 09:41
Download COCO dataset. Run under 'datasets' directory.
mkdir coco
cd coco
mkdir images
cd images
wget http://images.cocodataset.org/zips/train2017.zip
wget http://images.cocodataset.org/zips/val2017.zip
wget http://images.cocodataset.org/zips/test2017.zip
wget http://images.cocodataset.org/zips/unlabeled2017.zip
import numpy as np
import matplotlib.pyplot as plt
from IPython.display import clear_output
import time
n_particles = 100
for x in range(50):
clear_output(wait=True)
positions_x = [np.random.random() for i in range(n_particles)]
@jotterbach
jotterbach / plot_gaussian_process.py
Last active September 15, 2018 18:52
Snippet to demonstrate the conditioning procedure of a Gaussian Process and how to plot it.
import seaborn as sns
import numpy as np
import numpy.random as rd
import matplotlib.pyplot as plt
from scipy.spatial import distance as dist
import scipy.linalg as la
import itertools as it
%matplotlib inline