Skip to content

Instantly share code, notes, and snippets.

View dalequark's full-sized avatar
💭
🪂 slacking

Dale Markowitz dalequark

💭
🪂 slacking
View GitHub Profile
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
We couldn’t find that file to show.
{
"annotation_results": [ {
"input_uri": "/family_videos/myuserid/multi_shot_test.mp4",
"segment": {
"start_time_offset": {
},
"end_time_offset": {
"seconds": 70,
"nanos": 983000000
/*
* Media Translation Stream
* @param audio stream
* @param cb Callback function to execute with results
*/
async function transcribeAudioMediaStream(audio, cb) {
var isFirst = true;
const initialRequest = {
streamingConfig: {
#!/usr/bin/env python
# Copyright 2020 Google LLC
#
# 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
#
@dalequark
dalequark / df_stream_promise.js
Created February 3, 2020 17:28
DF Stream Promise
let queryResult;
return new Promise(resolve => {
let silent = true
detectStream.on('data', data => {
if (data.recognitionResult) {
silent = false
console.log(
`Intermediate transcript: ${data.recognitionResult.transcript}`
);
@dalequark
dalequark / DialogflowStream.js
Last active November 23, 2021 15:34
Create a continuous back-and-forth stream with dialogflow from mic
/**
* Copyright 2020 Google Inc. 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
@dalequark
dalequark / hello_world_keras.py
Created December 12, 2019 21:06
hello_world_keras.py
model = tf.keras.models.Sequential([
tf.keras.layers.Dense(512, activation='relu'),
tf.keras.layers.Dropout(0.2),
tf.keras.layers.Dense(32, activation='relu'),
tf.keras.layers.Dense(1, activation='softmax')
])
model.compile(optimizer='adam',
loss='sparse_categorical_crossentropy'),
metrics=['accuracy']))
model.fit(x_train, y_train, epochs=5)
const dialogflow = require('dialogflow');
const common = require('@google-cloud/common');
const record = require('node-record-lpcm16');
const uuidv1 = require('uuid/v1');
const pump = require('pump');
const Transform = require('readable-stream').Transform;
const fs = require('fs');
const Speaker = require('speaker');
const { PassThrough } = require('stream');
# import microphone_stream
import dialogflow_v2 as dialogflow
import pyaudio
import simpleaudio as sa
import re
import os
import sys
import time
PROJECT_ID = os.environ["PROJECT_ID"]