Skip to content

Instantly share code, notes, and snippets.

View mrtpk's full-sized avatar
🎯
Focusing

Thomas Paul mrtpk

🎯
Focusing
View GitHub Profile
@fclesio
fclesio / get_classification_report.py
Created March 4, 2020 12:21
Scikit Learn Classification Report in Dataframe
def get_classification_report(y_test, y_pred):
'''Source: https://stackoverflow.com/questions/39662398/scikit-learn-output-metrics-classification-report-into-csv-tab-delimited-format'''
from sklearn import metrics
report = metrics.classification_report(y_test, y_pred, output_dict=True)
df_classification_report = pd.DataFrame(report).transpose()
df_classification_report = df_classification_report.sort_values(by=['f1-score'], ascending=False)
return df_classification_report
@CMCDragonkai
CMCDragonkai / non_max_suppression.py
Last active July 3, 2021 18:10
Non-Maximum Suppression for Bounding Boxes #python #algorithms
import numpy as np
def non_max_suppression(boxes, scores, threshold):
assert boxes.shape[0] == scores.shape[0]
# bottom-left origin
ys1 = boxes[:, 0]
xs1 = boxes[:, 1]
# top-right target
ys2 = boxes[:, 2]
@mmautner
mmautner / Dockerfile
Created December 17, 2017 07:05
celery docker-compose example
FROM python:3.4
ADD . /app/
WORKDIR /app/
RUN pip install -r requirements.txt
CMD ["echo", "hello"]
@bigsnarfdude
bigsnarfdude / lidar_dump_numpy.py
Created May 12, 2017 16:40
[lidar2numpy] dump lidar data into numpy from rosbag
## https://gist.github.com/pierriko/fd49abfa2fb3561f9c89
## https://github.com/omgteam/Didi-competition-solution
## https://discussions.udacity.com/t/processing-velodyne-data-for-dataset-2/237084/7
# attach process: https://www.jetbrains.com/help/pycharm/2016.3/attaching-to-local-process.html
import sys
##sys.path.insert(0,'/opt/ros/kinetic/lib/python2.7/dist-packages')
##sys.path.insert(0,'/usr/lib/python2.7/dist-packages') ## rospkg
@mjdietzx
mjdietzx / residual_network.py
Last active March 26, 2024 06:33
Clean and simple Keras implementation of residual networks (ResNeXt and ResNet) accompanying accompanying Deep Residual Learning: https://blog.waya.ai/deep-residual-learning-9610bb62c355.
"""
Clean and simple Keras implementation of network architectures described in:
- (ResNet-50) [Deep Residual Learning for Image Recognition](https://arxiv.org/pdf/1512.03385.pdf).
- (ResNeXt-50 32x4d) [Aggregated Residual Transformations for Deep Neural Networks](https://arxiv.org/pdf/1611.05431.pdf).
Python 3.
"""
from keras import layers
from keras import models
@fchollet
fchollet / classifier_from_little_data_script_1.py
Last active July 27, 2024 19:40
Updated to the Keras 2.0 API.
'''This script goes along the blog post
"Building powerful image classification models using very little data"
from blog.keras.io.
It uses data that can be downloaded at:
https://www.kaggle.com/c/dogs-vs-cats/data
In our setup, we:
- created a data/ folder
- created train/ and validation/ subfolders inside data/
- created cats/ and dogs/ subfolders inside train/ and validation/
- put the cat pictures index 0-999 in data/train/cats
@baraldilorenzo
baraldilorenzo / readme.md
Last active September 19, 2024 23:23
VGG-16 pre-trained model for Keras

##VGG16 model for Keras

This is the Keras model of the 16-layer network used by the VGG team in the ILSVRC-2014 competition.

It has been obtained by directly converting the Caffe model provived by the authors.

Details about the network architecture can be found in the following arXiv paper:

Very Deep Convolutional Networks for Large-Scale Image Recognition

K. Simonyan, A. Zisserman

@dimitrs
dimitrs / flatten_label.py
Created June 15, 2014 13:32
Detect and flatten a label on a jar. Use both OpenCV-Python and SciKit-image since both are based on Numpy.
#Import both skimage and cv
from skimage import transform as tf
from skimage import io
import cv2
import numpy as np
from scipy import optimize
import matplotlib.pyplot as plt
# Could use either skimage or cv to read the image
@ff6347
ff6347 / clone_remote_branch.md
Last active April 13, 2023 19:34
clone remote branch with git
@egonSchiele
egonSchiele / canny.cpp
Created December 28, 2010 02:42
Adding automatic thresholding to cvCanny in OpenCV
// new
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//