Skip to content

Instantly share code, notes, and snippets.

View madilk's full-sized avatar

madilk

View GitHub Profile
@madilk
madilk / google cloud video intel api - object tracking in py - multiple videos.py
Created February 27, 2021 17:05
Google Cloud Video Intelligence API - Object Tracking Multiple Videos in Python
import os
os.environ['GOOGLE_APPLICATION_CREDENTIALS']='your-service-key.json'
"""Object tracking in a video stored on GCS."""
from google.cloud import videointelligence
video_client = videointelligence.VideoIntelligenceServiceClient()
features = [videointelligence.enums.Feature.OBJECT_TRACKING]
gcs_uri = 'gs://video_intel3/*.*'
output_uri = 'gs://video_intel3/response-multiple-video-intelligence-single-request.json'
@madilk
madilk / gganimate google analytics.r
Last active February 27, 2021 17:01
gganimate plot using google analytics
#http://code.markedmondson.me/googleAnalyticsR/articles/setup.html
install.packages("googleAnalyticsR")
library(googleAnalyticsR)
#change location to your service key folder
ga_auth(json_file = "C:\\location-folder-for your-service-account-json\\service-key.json")
account_list <- ga_account_list()
account_list$viewId
@madilk
madilk / Google Analytics Content Segmentation K Means Clustering.r
Last active February 27, 2021 16:53
Google analytics content segmentation k means segmentation in R
#install packages
install.packages("googleAnalyticsR")
install.packages("tidyverse")
#load libraries
library(googleAnalyticsR)
library(tidyverse)
#creating service account json key
#http://code.markedmondson.me/googleAnalyticsR/articles/setup.html