This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| API_BASE_URL=http://localhost:8000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ####################################################### | |
| ## 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ''' | |
| "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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| import argparse | |
| import json | |
| import pathlib | |
| from tensorboard.backend.event_processing import event_accumulator | |
| def main(): | |
| parser = argparse.ArgumentParser() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ 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 | |
| """ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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)] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |