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
package global.skymind.training.segmentation.car; | |
import org.deeplearning4j.nn.api.OptimizationAlgorithm; | |
import org.deeplearning4j.nn.conf.*; | |
import org.deeplearning4j.nn.conf.graph.MergeVertex; | |
import org.deeplearning4j.nn.conf.inputs.InputType; | |
import org.deeplearning4j.nn.conf.layers.*; | |
import org.deeplearning4j.nn.graph.ComputationGraph; | |
import org.deeplearning4j.nn.weights.WeightInit; | |
import org.nd4j.linalg.activations.Activation; |
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 face_alignment | |
import matplotlib.pyplot as plt | |
from mpl_toolkits.mplot3d import Axes3D | |
from skimage import io | |
import collections | |
from timeit import default_timer as timer | |
# Run the 3D face alignment on a test image, without CUDA. | |
fa = face_alignment.FaceAlignment(face_alignment.LandmarksType._2D, device='cpu', flip_input=True, face_detector='sfd') |
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 thresh_callback(val): | |
threshold = val | |
_,thres_out = cv.threshold(src_gray, 230, 255, | |
cv.THRESH_BINARY) | |
canny_output = cv.Canny(thres_out, threshold, threshold * 2) | |
contours, _ = cv.findContours(canny_output, cv.RETR_TREE, cv.CHAIN_APPROX_SIMPLE) | |
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 org.datavec.image.loader.NativeImageLoader; | |
import org.nd4j.linalg.api.ndarray.INDArray; | |
import static org.bytedeco.opencv.global.opencv_highgui.*; | |
NativeImageLoader nil = new NativeImageLoader(416,416, 3); | |
INDArray image = nil.asMatrix("C:\\Users\\choowilson\\Desktop\\potato.jpg").div(255.0); | |
Mat mat = nil.asMat(image); | |
imshow("Output",mat); | |
waitKey(0); | |
destroyAllWindows(); |
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 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; |
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 org.deeplearning4j.nn.graph.ComputationGraph; | |
import org.deeplearning4j.nn.modelimport.keras.KerasModelImport; | |
import org.deeplearning4j.nn.modelimport.keras.exceptions.InvalidKerasConfigurationException; | |
import org.deeplearning4j.nn.modelimport.keras.exceptions.UnsupportedKerasConfigurationException; | |
public void initKeras() throws InvalidKerasConfigurationException, IOException, UnsupportedKerasConfigurationException { | |
ComputationGraph model = KerasModelImport.importKerasModelAndWeights("model.h5"); | |
} |
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 java.awt.event.KeyEvent; | |
import java.awt.event.KeyListener; | |
public class MyKeylistener implements KeyListener { | |
@Override | |
public void keyPressed(KeyEvent keyEvent) { | |
if (keyEvent.getKeyCode() == KeyEvent.VK_ENTER){ | |
System.out.println("ENTER Pressed"); | |
} |
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 net.schmizz.sshj.SSHClient; | |
import net.schmizz.sshj.connection.channel.direct.Session; | |
import net.schmizz.sshj.transport.verification.PromiscuousVerifier; | |
import java.io.IOException; | |
public class sendCommand { | |
public static void main(String[] args) throws IOException { | |
final SSHClient ssh = new SSHClient(); | |
ssh.addHostKeyVerifier(new PromiscuousVerifier()); |
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 net.schmizz.sshj.SSHClient; | |
import net.schmizz.sshj.connection.channel.direct.Session; | |
import net.schmizz.sshj.transport.verification.PromiscuousVerifier; | |
import java.io.IOException; | |
public class sendCommand { | |
public static void main(String[] args) throws IOException { | |
final SSHClient ssh = new SSHClient(); | |
ssh.addHostKeyVerifier(new PromiscuousVerifier()); |
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 RPi.GPIO as GPIO | |
import time | |
GPIO.setmode(GPIO.BOARD) # Raspi board GPIO Pin Number | |
GPIO.setup(11, GPIO.OUT) # Output pin is GPIO Pin 17 | |
# Initial state for LEDs: | |
print("Testing GPIO Pin11 out, Press CTRL+C to exit") |
NewerOlder