Skip to content

Instantly share code, notes, and snippets.

View JarvusChen's full-sized avatar

Jarvus JarvusChen

View GitHub Profile
@JarvusChen
JarvusChen / trainPlateCTC.py
Created July 14, 2018 05:46
Train model for plate numbers by CTC loss
import numpy as np
import pylab
import cv2
from keras import backend as K
from keras.layers.convolutional import Conv2D, MaxPooling2D
from keras.layers import Input, Dense, Activation, Reshape, Lambda, Dropout
from keras.layers.merge import add, concatenate
from keras.layers.recurrent import GRU
from keras.models import Model
from keras.optimizers import SGD
@JarvusChen
JarvusChen / predictPlateCTC.py
Last active July 14, 2018 06:00
Predict plate number by CTC loss
# predict number
X = cv2.imread('test1.jpg')
X = X.transpose(1, 0, 2).reshape(1,70,30,3)
y_pred = base_model.predict(X)
y_pred = y_pred[:,2:,:]
out = K.get_value(K.ctc_decode(y_pred, input_length=np.ones(y_pred.shape[0])*y_pred.shape[1], )[0][0])[:, :7]
out = ''.join([chars[x] for x in out[0]])
print(out)
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Homepage Leaderboard -->
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-1234567890123456"
data-ad-slot="1234567890">
</ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
@JarvusChen
JarvusChen / audioCommon.m
Last active July 11, 2017 09:06
MATLAB common code in Audio
%% Updated on Jun., 2017 ------------------------------------------------
% Copyright by Jarvus Chen. All Rights Reserved.
% www.jarvus.net
%% Read and Plot ---------------------------------------------------------
clear
clc
close all
% read audio file
@JarvusChen
JarvusChen / functionTest.ino
Created June 25, 2017 07:08
Using arrays as parameters and return values
/**************************************************************
25, Jun., 2017
Copyright by Jarvus Chen. All Rights Reserved.
www.jarvus.net
************************************************************** */
void setup() {
Serial.begin(9600);
Serial.println("Start");
}
@JarvusChen
JarvusChen / teensyRecordWAV.ino
Last active December 10, 2022 18:18
Use Teensy 3.6 and audio board to record WAV files by MIC in the SD card.
#include <SPI.h>
#include <SD.h>
#include <SD_t3.h>
#include <SerialFlash.h>
#include <Audio.h>
#include <Wire.h>
//write wav
unsigned long ChunkSize = 0L;
#include <WiFi.h>
#include <WiFiClient.h>
char ssid[] = "JarvusChen"; // your network SSID (name)
char pass[] = "wwwjarvusnet"; // your network password
int status = WL_IDLE_STATUS; // the Wifi radio's status
// Initialize the Wifi client library
WiFiClient client;
<?php
require_once 'firebaseLib.php';
// --- This is your Firebase URL
$url = 'https://jarvus.firebaseio.com/';
// --- Use your token from Firebase here
$token = 'h1aX4FcGVsU5Ix81dG6qgmUQ7eeBRuati7Fzs8yt';
// --- Here is your parameter from the http GET
// --- you can add whatever you want
$data1 = $_GET['data1'];
$data2 = $_GET['data2'];
<?php
/**
* Firebase PHP Client Library
*
* @author Tamas Kalman <ktamas77@gmail.com>
* @link https://www.firebase.com/docs/rest-api.html
*
*/
@JarvusChen
JarvusChen / noteWenForm.php
Last active March 26, 2016 13:50
PHP form DEMO
<script type="text/javascript">
function checkFunc(){
var f = document.form.check;
var b = document.form.YourName;
if (b.value == ""){
alert("請填寫姓名")
return false;
}
if (f.checked){