Skip to content

Instantly share code, notes, and snippets.

View kunal732's full-sized avatar

Kunal Batra kunal732

  • HelloDX
  • United States
View GitHub Profile
@kunal732
kunal732 / example.py
Created April 24, 2019 20:26
for webinar
import boto3
import base64
from chalice import Chalice
app = Chalice(app_name='example1')
@app.on_s3_event(bucket='rekogvtug')
def handler(event):
@kunal732
kunal732 / Setup.txt
Last active April 19, 2018 16:37
Building an Image Classifier Ingredients
#First item is to make sure you have Docker installed. We'll be using docker to setup a tensorflow image.
To make sure docker is installed properly you can run the
'docker hello-world'
image and should get the appropriate response.
#To install and an image with tensorflow
docker run -it tensorflow/tensorflow bash
#Download and unzip the Tensorflow for poets scripts
curl -O http://104.131.75.92:8000/tensorflow-for-poets-2-master.zip
@kunal732
kunal732 / celeb.py
Created April 8, 2018 07:18
Calling the Clarifai Celebrity model.
from clarifai.rest import ClarifaiApp
from clarifai.rest import Image as ClImage
#put api key
app = ClarifaiApp(api_key='')
model = app.models.get('celeb-v1.3')
#put photo url below
image = ClImage(url='')
@kunal732
kunal732 / sample-predict.py
Created January 31, 2018 20:42
Sample Clarifai App
from clarifai.rest import ClarifaiApp
from clarifai.rest import Image as ClImage
app = ClarifaiApp(api_key='your_api_key')
model = app.models.get('general-v1.3')
image = ClImage(url='https://samples.clarifai.com/metro-north.jpg')
response = model.predict([image])
concepts = response['outputs'][0]['data']['concepts']
@kunal732
kunal732 / AppDelegate.Swift
Created January 20, 2018 17:18
Just looking at the top result for Predictions through the Clarifai Apple SDK - Partial AppDelegate.Swift file.
//
// AppDelegate.swift
// third
//
// Created by Kunal Batra on 1/16/18.
// Copyright © 2018 Kunal Batra. All rights reserved.
//
import UIKit
import Clarifai_Apple_SDK
@kunal732
kunal732 / kunaldemo.py
Created December 11, 2015 21:29
kunaldemo
from flask import Flask, request
import json
import httplib
import os
app = Flask(__name__)
@app.route('/email', methods=['POST'])
def form():
subject=request.form['subject']
@kunal732
kunal732 / SendGrid Parse Cloud Code
Created October 24, 2015 20:07
bvp hackathon sendgrid parse cloudcode
var sendgrid = require("sendgrid");
sendgrid.initialize("username", "password");
// Use Parse.Cloud.define to define as many cloud functions as you want.
// For example:
Parse.Cloud.define("hello", function(request, response) {
response.success("testing email");
sendgrid.sendEmail({
to: "[email protected]",
from: "[email protected]",
@kunal732
kunal732 / gridbase.py
Created January 20, 2015 00:22
Gets crunchbase analysis of sending email domain and returns an email to the user
from flask import Flask, request
import sendgrid
import requests
app = Flask(__name__)
@app.route ('/incoming', methods =['POST'])
def nextweb():
subject = request.form['subject']
@kunal732
kunal732 / captain_crunchgrid.py
Created January 19, 2015 23:44
Crunchbase and SendGrid mashup
from flask import Flask, request
import sendgrid
import requests
app = Flask(__name__)
@app.route ('/incoming', methods =['POST'])
def nextweb():
subject = request.form['subject']
body = request.form['text']
@kunal732
kunal732 / firegrid.py
Created January 6, 2015 17:43
pushing sendgrid event webhook into firebase
rom flask import Flask, request
import json, requests
from firebase import firebase
app = Flask(__name__)
firebase = firebase.FirebaseApplication('Your_Firebase_url_goes_here', None)
@app.route('/',methods=['POST'])
def foo():
json2 = request.json