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 argparse | |
ap = argparse.ArgumentParser(description="Script Description") | |
ap.add_argument("-s", "--string", required=True, help="Argument help.", type=str) | |
ap.add_argument("-n", "--number", default=0.0, help="Argument help.", type=float) | |
ap.add_argument("-l", "--list", nargs="+", type=int) | |
ap.add_argument('--feature1', dest='feature1', action='store_true') | |
ap.add_argument('--no-feature2', dest='feature2', action='store_false') | |
ap.set_defaults(feature1=False, feature2=True) |
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 logging | |
import sys | |
from logging.handlers import TimedRotatingFileHandler | |
FORMATTER = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s") | |
LOG_FILE = "my_app.log" | |
def get_console_handler(): | |
console_handler = logging.StreamHandler(sys.stdout) | |
console_handler.setFormatter(FORMATTER) |
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 cv2 | |
from os import path | |
from math import floor | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from tqdm import tqdm | |
#from tqdm import tqdm_notebook as tqdm # for jupyter notebooks | |
# Video to Frame | |
def get_frame(video, second, save_folder=None, prefix="frame", resize=None, to_rgb=True, prefix_padding=4): |
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
""" | |
Use this script to download the images from the url.txt, then is necesary to manual prunning irrelevant images from our dataset | |
""" | |
# import the necessary packages | |
from imutils import paths | |
import argparse | |
import requests | |
import cv2 |
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 | |
from tensorflow.python.client import timeline | |
import keras | |
tl = timeline.Timeline(run_metadata.step_stats) | |
ctf = tl.generate_chrome_trace_format() | |
run_options = tf.RunOptions(trace_level=tf.RunOptions.FULL_TRACE) | |
run_metadata= tf.RunMetadata() |
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 os | |
import glob | |
from tqdm import tqdm | |
from collections import Counter | |
def rename_submissions(submissions_folder, output_folder=None): | |
""" | |
Rename submissions downloaded from Moodle (download all submissions option). | |
Use it when the name of the submited files are differents between each student | |
and contains identification info in it. |
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
#include <stdio.h> | |
#include <tensorflow/c/c_api.h> | |
int main() { | |
printf("Hello from TensorFlow C library version %s\n", TF_Version()); | |
return 0; | |
} |
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
name: power | |
source code: |- | |
input: '11#111' | |
blank: ' ' | |
start state: setup_a | |
table: | |
setup_a: | |
1 : {write: 'x', L} | |
' ' : {write: '=', L: setup_b} |
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
name: binary palindrome enumerator | |
source code: | | |
# Adds 1 to a binary number. | |
input: '' | |
blank: ' ' | |
start state: setup_a | |
table: | |
# binary generator | |
setup_a: | |
' ' : {write: '#', L: setup_b} |
OlderNewer