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
function getUserByToken($token) | |
{ | |
$data = array("idToken" => $token); | |
$data_string = json_encode($data); | |
$ch = curl_init('https://identitytoolkit.googleapis.com/v1/accounts:lookup?key=' . API_KEY); | |
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); | |
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
curl_setopt( |
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
/* Copyright 2019 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 | |
distributed under the License is distributed on an "AS IS" BASIS, | |
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
See the License for the specific language governing permissions and | |
limitations under the License. |
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 numpy as np | |
import tensorflow as tf | |
# Load TFLite model and allocate tensors. | |
interpreter = tf.lite.Interpreter(model_path="converted_model.tflite") | |
interpreter.allocate_tensors() | |
# Get input and output tensors. | |
input_details = interpreter.get_input_details() | |
output_details = interpreter.get_output_details() |
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 org.tensorflow.lite.examples.digitclassifier | |
import android.content.Context | |
import android.content.res.AssetManager | |
import android.graphics.Bitmap | |
import android.util.Log | |
import com.google.android.gms.tasks.Task | |
import com.google.android.gms.tasks.Tasks.call | |
import java.io.FileInputStream | |
import java.io.IOException |
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
// Simple TODO react native app | |
// based on https://codeburst.io/todo-app-with-react-native-f889e97e398e | |
import React, { Component } from 'react'; | |
import { StyleSheet, Text, View, FlatList, TextInput, Keyboard, Button } from 'react-native'; | |
const isAndroid = Platform.OS == "android"; | |
export default class App extends Component { |
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 React, { Component } from 'react'; | |
import { StyleSheet, Text, View, Button } from 'react-native'; | |
export default class App extends Component { | |
constructor() { | |
super() | |
this.state = {text: 'Hello World!'} | |
} |
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 {Cifar10} from './data.js'; | |
async function load () { | |
const data = new Cifar10() | |
await data.load() | |
const model = await tf.loadLayersModel('./model/model.json'); | |
//tfvis.show.modelSummary({name: 'Model Architecture'}, model); | |
const class_names = ['airplane', 'automobile', 'bird', 'cat', 'deer', |
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 {Cifar10} from './data.js'; | |
async function load () { | |
const data = new Cifar10() | |
await data.load() | |
const [train_images, train_labels] = data.nextTrainBatch(); | |
const [test_images, test_labels] = data.nextTestBatch(); | |
console.log(train_images, train_labels, test_images, test_labels); |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>TensorFlow.js Tutorial</title> | |
<!-- Import TensorFlow.js --> | |
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@1.0.0/dist/tf.min.js"></script> |
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
# MINST GAN Example | |
# based on https://www.tensorflow.org/tutorials/generative/dcgan | |
import numpy as np | |
import tensorflow as tf | |
import matplotlib.pyplot as plt | |
from tensorflow.keras import layers, models | |
import time | |
BUFFER_SIZE = 60000 |