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 necessary libraries | |
import argparse # Command-line argument parsing | |
import json # JSON handling | |
# Google Cloud Storage library for interacting with buckets and objects | |
from google.cloud import storage | |
# Function to extract bucket name and folder from a Google Storage location | |
def get_bucket_folder(location): |
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
from flask import Flask, send_from_directory | |
app = Flask(__name__) | |
@app.route('/') | |
def index(): | |
return 'Hello, World!' | |
@app.route('/<path:path>') | |
def serve_files(path): |
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 onOpen() { | |
var ui = SpreadsheetApp.getUi(); | |
ui.createMenu("🔮 Predictions for cell") | |
.addItem('🌸 Iris', 'predict_on_row') | |
.addToUi(); | |
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
#!/usr/bin/env python3 | |
# rpi_ws281x library strandtest example | |
# Author: Tony DiCola ([email protected]) | |
# | |
# Direct port of the Arduino NeoPixel library strandtest example. Showcases | |
# various animations on a strip of NeoPixels. | |
import time | |
from rpi_ws281x import * | |
import argparse |
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
# given a folder of videos, generate thumbnails for each video and store them in a new folder structure | |
# !pip install opencv-python | |
# !sudo apt-get install ffmpeg libsm6 libxext6 -y | |
import cv2 | |
import os | |
from PIL import Image | |
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
from google.cloud import storage | |
folder_location = 'YOUR GCS FOLDER LOCATION' # e.g automl-ui-dataset/x-ray-dataset | |
parts = folder_location.split('/') | |
bucket_name = parts[0] | |
prefix = '/'.join(parts[1:]) if len(parts) > 1 else '' | |
storage_client = storage.Client() | |
blobs = storage_client.list_blobs(bucket_name, prefix=prefix) |
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
from google.cloud import videointelligence | |
import time | |
video_client = videointelligence.VideoIntelligenceServiceClient() | |
OUTPUT_BUCKET = 'gs://YOUR OUTPUT BUCKET NAME/' | |
features = [ | |
videointelligence.Feature.OBJECT_TRACKING |
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
from google.cloud import storage | |
folder_location = 'automl-ui-dataset/x-ray-dataset' | |
parts = folder_location.split('/') | |
prefix = '/'.join(parts[1:]) if len(parts) > 1 else '' | |
storage_client = storage.Client() | |
blobs = storage_client.list_blobs(parts[0], prefix=prefix) |
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 io | |
import numpy as np | |
import imageio | |
import cv2 | |
from google.cloud import storage | |
from google.cloud import videointelligence_v1p3beta1 as videointelligence | |
storage_client = storage.Client() |
NewerOlder