Skip to content

Instantly share code, notes, and snippets.

@androuino
androuino / SystemUITest.groovy
Last active August 19, 2019 05:20
Test Example
package com.example.ui
import com.github.naoghuman.lib.i18n.core.I18NResourceBundleBuilder
import com.example.common.core.SysInfo
import com.example.ui.system.handler.AppViewHandler
import groovy.transform.CompileStatic
import javafx.scene.image.Image
import javafx.stage.Stage
import org.junit.BeforeClass
import org.junit.jupiter.api.Test
@androuino
androuino / DetectorActivity.java
Last active May 9, 2019 08:12
DetectorActivity.java
/*
* Copyright 2016 The TensorFlow Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
Printing the value of NDArray [
2
[
3
[
4
[255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,254.0,254.0,254.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,255.0,254.0,252.0,251.0,250.0,255.0,255.0,255.0,252.0,252.0,254.0,255.0,255.0,255.0,252.0,252.0,251.0,243.0,245.0,243.0,223.0,182.0,140.0,124.0,142.0,187.0,227.0,244.0,244.0,235.0,168.0,85.0,40.0,22.0,5.0,10.0,10.0,11.0,10.0,9.0,9.0,8.0,8.0,8.0,8.0,8.0,8.0,8.0,8.0,8.0,8.0,8.0,8.0,8.0,8.0,8.0,8.0,8.0,8.0,8.0,8.0,9.0,9.0,9.0,9.0,9.0,9.0,8.0,9.0,10.0,11.0,12.0,12.0,11.0
package mxnet;
import org.apache.mxnet.infer.javaapi.ObjectDetector;
import org.apache.mxnet.infer.javaapi.ObjectDetectorOutput;
import org.apache.mxnet.infer.javaapi.Predictor;
import org.apache.mxnet.javaapi.*;
import java.awt.image.BufferedImage;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
"""Train YOLOv3 with random shapes."""
import argparse
import os
import logging
import time
import warnings
import numpy as np
import mxnet as mx
from mxnet import nd
from mxnet import gluon
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
Exception in thread "main" java.lang.UnsatisfiedLinkError: /tmp/mxnet463915887770065837/mxnet-scala: libcudart.so.9.2: cannot open shared object file: No such file or directory
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1824)
at java.lang.Runtime.load0(Runtime.java:809)
at java.lang.System.load(System.java:1086)
at org.apache.mxnet.util.NativeLibraryLoader$.loadLibraryFromFile(NativeLibraryLoader.scala:131)
at org.apache.mxnet.util.NativeLibraryLoader$.loadLibrary(NativeLibraryLoader.scala:99)
at org.apache.mxnet.Base$.<init>(Base.scala:72)
at org.apache.mxnet.Base$.<clinit>(Base.scala)
{
"nodes": [
{
"op": "null",
"name": "data",
"inputs": []
},
{
"op": "null",
"name": "darknetv30_conv0_weight",
@androuino
androuino / gist:c88c721f3648902dc4f1dd83e62c08a9
Last active October 24, 2018 03:38
Displaying Evaluation on Objectect Detection Dataset Iterator
package org.deeplearning4j.examples.convolution.objectdetection;
import java.io.File;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import org.bytedeco.javacv.CanvasFrame;
import org.bytedeco.javacv.OpenCVFrameConverter;
package org.deeplearning4j.examples.convolution.objectdetection;
import java.io.File;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.List;
import java.util.Random;
import org.bytedeco.javacv.CanvasFrame;
import org.bytedeco.javacv.OpenCVFrameConverter;
import org.datavec.api.io.filters.RandomPathFilter;