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 | |
import argparse | |
from pathlib import Path | |
import os | |
def crop(img, height, width): | |
img_h, img_w = img.shape[0], img.shape[1] | |
crop_h = height if height < img_h else img_h | |
crop_w = width if width < img_w else img_w |
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 albumentations as A | |
import cv2 | |
from pathlib import Path | |
import argparse | |
import xml.etree.ElementTree as ET | |
import shutil | |
import os | |
def augment(image, xml_file): | |
bboxes, labels = get_bounding_boxes_and_labels(xml_file) |
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
""" | |
Make sure you have already created a .tar file for the files you want to export from Colab. | |
!tar -czvf /content/name_of_tarfile.tar.gz <files_or_directories> | |
""" | |
from google.colab import files | |
files.download("/content/name_of_tarfile.tar.gz") |
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
<template> | |
<div class="container"> | |
<!-- just add the component --> | |
<trend | |
:data="[1,3,3,4,3,5]" | |
:gradient="['#6fa8dc', '#42b983', '#2c3e50']" | |
auto-draw | |
smooth | |
></trend> | |
</div> |
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 matplotlib.pyplot as plt | |
import os, json | |
from glob import glob | |
import tensorflow.keras | |
import tensorflow as tf | |
from tensorflow.keras.applications import inception_v3, vgg16 | |
from tensorflow.keras.preprocessing import image | |
from tensorflow.keras.models import Model |
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 <iostream> | |
#include <string> | |
#include <regex> | |
using namespace std; | |
bool email_regex(const string& email){ | |
const regex pattern ("(\\w+)(\\.|_|-)?(\\w*)@(\\w+)(\\.(\\w+))+"); | |
return regex_match(email, pattern); | |
} |
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
<?php | |
function esc_url($url){ | |
if ('' == $url) { | |
return $url; | |
} | |
$url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%@$\|*\'()\\x80-\\xff]|i', '', $url); | |
$strip = array('%0D', '%0A', '%0d', '%0a'); | |
$url = (string) $url; | |
$count = 1; |
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
int data = 0; | |
void setup(){ | |
Serial.begin(9600); | |
pinMode(LED_BUILTIN, OUTPUT); | |
Serial.println("Initializing..."); | |
} | |
void loop(){ | |
while(Serial.available()){ |
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 <Adafruit_NeoPixel.h> | |
#ifdef __AVR__ | |
#include <avr/power.h> | |
#endif | |
#define PIN 6 | |
Adafruit_NeoPixel strip = Adafruit_NeoPixel(60, PIN, NEO_GRB + NEO_KHZ800); | |
int count = '0'; |