Skip to content

Instantly share code, notes, and snippets.

View HengJayWang's full-sized avatar

HengJay HengJayWang

View GitHub Profile
import SwiftUI
import Foundation
struct ContentView: View {
// 1.
private var startPoint1 = CGPoint(x: 207, y: 359)
@State private var currentPosition1: CGSize = .zero
@State private var newPosition1: CGSize = .zero
@State private var isDragging1 = false
name: tf2
channels:
- defaults
dependencies:
- attrs=19.1.0=py36_1
- backcall=0.1.0=py36_0
- blas=1.0=mkl
- bleach=3.1.0=py36_0
- ca-certificates=2019.8.28=0
- certifi=2019.9.11=py36_0
@HengJayWang
HengJayWang / tensorflow-gpu-2-0.yml
Created October 6, 2019 15:33
Using .yml file create conda env for Tensorflow 2.0
name: tf2
channels:
- defaults
dependencies:
- attrs=19.1.0=py36_1
- backcall=0.1.0=py36_0
- blas=1.0=mkl
- bleach=3.1.0=py36_0
- ca-certificates=2019.8.28=0
- certifi=2019.9.11=py36_0
@HengJayWang
HengJayWang / tensorflow-gpu-2-0.yml
Created October 6, 2019 15:33
Using .yml file create conda env for Tensorflow 2.0
name: tf2
channels:
- defaults
dependencies:
- attrs=19.1.0=py36_1
- backcall=0.1.0=py36_0
- blas=1.0=mkl
- bleach=3.1.0=py36_0
- ca-certificates=2019.8.28=0
- certifi=2019.9.11=py36_0
@HengJayWang
HengJayWang / Spectrogram with Tensorflow
Last active June 28, 2019 09:17
Implement Spectrogram with Tensorflow, and convert to TFlite file for Android. (Convert failed !)
import tensorflow as tf
from tensorflow.signal import stft
# Waveform placeholder
waveform = tf.placeholder(name="waveform", dtype=tf.float32, shape=(4000))
# Compute the spectrogram and get the asolute values
stfts = stft(waveform, frame_length=256, frame_step=64, fft_length=256)
spectrograms = tf.abs(stfts)
package com.bdl.itri.filebrowserexample.filebrowserexample;
import android.Manifest;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.text.method.ScrollingMovementMethod;
@HengJayWang
HengJayWang / Transfer_Learning_Keras_01.py
Created September 20, 2017 05:44 — forked from prakashjayy/Transfer_Learning_Keras_01.py
Transfer Learning using Keras
from keras import applications
from keras.preprocessing.image import ImageDataGenerator
from keras import optimizers
from keras.models import Sequential, Model
from keras.layers import Dropout, Flatten, Dense, GlobalAveragePooling2D
from keras import backend as k
from keras.callbacks import ModelCheckpoint, LearningRateScheduler, TensorBoard, EarlyStopping
img_width, img_height = 256, 256
train_data_dir = "data/train"