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
(base) D:\Efficient-PyTorch\tools>python folder2lmdb.py -f "C:\Users\ChooWilson\.fastai\data\kaggle-cat-dog" -s train | |
Loading dataset from C:\Users\ChooWilson\.fastai\data\kaggle-cat-dog\train | |
Generate LMDB to C:\Users\ChooWilson\.fastai\data\kaggle-cat-dog\train.lmdb | |
2000 2000 | |
Traceback (most recent call last): | |
File "folder2lmdb.py", line 181, in <module> | |
folder2lmdb(args.folder, num_workers=args.procs, name=args.split) | |
File "folder2lmdb.py", line 150, in folder2lmdb | |
for idx, data in enumerate(data_loader): | |
File "C:\Users\ChooWilson\Anaconda3\lib\site-packages\torch\utils\data\dataloader.py", line 279, in __iter__ |
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
#Original source from https://github.com/opencv/opencv/blob/master/samples/python/tutorial_code/ShapeDescriptors/hull/hull_demo.py | |
from __future__ import print_function | |
import cv2 as cv | |
import numpy as np | |
import argparse | |
import random as rng | |
rng.seed(12345) |
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
class myCallback(tf.keras.callbacks.Callback): | |
def on_epoch_end(self, epoch, logs={}): | |
if(logs.get('acc')>0.6): | |
print("\nReached 60% accuracy so cancelling training!") | |
self.model.stop_training = True |
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 org.bytedeco.ffmpeg.global.avcodec; | |
import org.bytedeco.ffmpeg.global.avutil; | |
import org.bytedeco.javacv.*; | |
import org.bytedeco.opencv.opencv_core.*; | |
import static org.bytedeco.opencv.global.opencv_imgproc.*; | |
import static org.bytedeco.opencv.helper.opencv_core.RGB; | |
import org.bytedeco.opencv.opencv_videoio.VideoWriter; | |
import org.datavec.image.loader.NativeImageLoader; | |
import org.datavec.image.transform.ColorConversionTransform; | |
import org.deeplearning4j.nn.graph.ComputationGraph; |
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
int baseline[]={0}; | |
Size textSize=getTextSize("Hello World", FONT_HERSHEY_DUPLEX, 1,1,baseline); | |
int textwidth=textSize.get(0); | |
int textheight=textSize.get(1); | |
rectangle(yourMat, new Point(x1 + 2, y2 - 2), new Point(x1 + 2+textwidth, y2 - 2-textheight),RGB(255,255,0), FILLED,0,0); | |
putText(yourMat, "Hello World", new Point(x1 + 2, y2 - 2), FONT_HERSHEY_DUPLEX, 1, RGB(0,0,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
int baseline[]={0}; | |
Size textSize=getTextSize("Hello World", FONT_HERSHEY_DUPLEX, 1,1,baseline); | |
int textwidth=textSize.get(0); | |
int textheight=textSize.get(1); | |
rectangle(yourMat, new Point(x1 + 2, y2 - 2), new Point(x1 + 2+textwidth, y2 - 2-textheight),RGB(255,255,0), FILLED,0,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
import timeit | |
import time | |
start_time = timeit.default_timer() | |
# Using time module to create the delay, you can replce this line with your process | |
time.sleep(1) | |
end_time = timeit.default_timer() | |
elapsed_time = end_time - start_time | |
# Round the elapsed time to 2 decimal points | |
print("Elapsed time: {}".format(round(elapsed_time,2))) |
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 java.util.concurrent.TimeUnit; | |
public class JavaTimer{ | |
public static void main(String []args){ | |
long start_time =System.nanoTime(); | |
//Create a delay of 1 second or 1000milliseconds | |
try{ | |
Thread.sleep(1000); |
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
apply plugin: 'com.android.application' | |
android { | |
compileSdkVersion 27 | |
buildToolsVersion "28.0.3" | |
defaultConfig { | |
applicationId "com.yptheangel.dl4jandroid.yolo_objdetection" | |
minSdkVersion 24 | |
targetSdkVersion 24 | |
versionCode 1 |
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
package com.yptheangel.dl4jandroid.yolo_objdetection; | |
import android.app.Activity; | |
import android.os.AsyncTask; | |
import android.os.Bundle; | |
import android.os.Environment; | |
import android.util.Log; | |
import com.yptheangel.dl4jandroid.yolo_objdetection.utils.VOCLabelsAndroid; | |
import static android.os.Environment.getExternalStoragePublicDirectory; |