Emoji | Purpose | MD Markup | Prefix |
---|---|---|---|
📄 | Generic message | :page_facing_up: |
|
📐 | Improve the format / structure of the code / files | :triangular_ruler: |
[IMPROVE]: |
⚡ | Improve performance | :zap: |
[IMPROVE]: |
🚀 | Improve something (anything) | :rocket: |
[IMPROVE]: |
📝 | Write docs | :memo: |
[PROD]: |
💡 | New idea |
This file contains 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 cv2 | |
class BackGroundSubtractor: | |
# When constructing background subtractor, we | |
# take in two arguments: | |
# 1) alpha: The background learning factor, its value should | |
# be between 0 and 1. The higher the value, the more quickly | |
# your program learns the changes in the background. Therefore, |
This file contains 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 tensorflow as tf | |
x = tf.Variable(2, name='x', dtype=tf.float32) | |
log_x = tf.log(x) | |
log_x_squared = tf.square(log_x) | |
optimizer = tf.train.GradientDescentOptimizer(0.5) | |
train = optimizer.minimize(log_x_squared) | |
init = tf.initialize_all_variables() |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
CAP_PROP_POS_MSEC =0, //!< Current position of the video file in milliseconds. | |
CAP_PROP_POS_FRAMES =1, //!< 0-based index of the frame to be decoded/captured next. | |
CAP_PROP_POS_AVI_RATIO =2, //!< Relative position of the video file: 0=start of the film, 1=end of the film. | |
CAP_PROP_FRAME_WIDTH =3, //!< Width of the frames in the video stream. | |
CAP_PROP_FRAME_HEIGHT =4, //!< Height of the frames in the video stream. | |
CAP_PROP_FPS =5, //!< Frame rate. | |
CAP_PROP_FOURCC =6, //!< 4-character code of codec. see VideoWriter::fourcc . | |
CAP_PROP_FRAME_COUNT =7, //!< Number of frames in the video file. | |
CAP_PROP_FORMAT =8, //!< Format of the %Mat objects returned by VideoCapture::retrieve(). | |
CAP_PROP_MODE =9, //!< Backend-specific value indicating the current capture mode. |
This file contains 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
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 |