Skip to content

Instantly share code, notes, and snippets.

View karthik20522's full-sized avatar
👊

Karthik Srinivasan karthik20522

👊
View GitHub Profile
@karthik20522
karthik20522 / img_benchmark.js
Created November 22, 2013 19:01
Image processing benchmark - NodeJS
var fs = require('fs');
var vips = require('../index');
var imagemagick = require("imagemagick");
var gm = require("gm");
var epeg = require("epeg");
var async = require("async");
var assert = require("assert");
var Benchmark = require("benchmark");
var cv = require("opencv");
@karthik20522
karthik20522 / Blog
Last active December 29, 2015 03:09
Gettyimage tech blog
For a company such as GettyImages with a complex image workflows involving ingestion of images,
preprocessing of images, generating asset packs of various image sizes and finally distributing
those images to 1000's of customers each expecting image sizes of various dimensions all in a
matter of seconds if not minutes; having an extremely fast and reliable image processing system
is critical to its business. While there are countless image processing tools and frameworks out
there that can be used for image processing, following benchmark is to determine the fastest resizer tool.
For this benchmark the following most widely used image processing libraries were considered.
Please note that resizing is one of the most widely performed operation while distributing images
to customers at Gettyimages, hence the following benchmark is based on image resizing.
@karthik20522
karthik20522 / 500px
Created January 3, 2014 02:53
500px
Q) How would you detect users who manipulate photos rating by creating fake accounts?
Couple of ways to detect same users:
- drop a unique cookie on the user system which will help determine if different users came from the same computer. A post processing service can be setup to check different users from same computer.
- limit the number of ratings that an IP or a user can perform in set period of time
- to avoid automatic bot based rating, have the rating button to be a randomly lazy enabled.
Q) What would you change on 500px.com and why?
An image is worth nothing if it cannot be discovered. 500px thou serving top quality images has a very minimal search capability. Image discovery is probably the most important feature that I would recommend for 500px. Image discovery features such as:
- search image by dominany color
- search image by number of faces (face detection, gender detection, age estimation etc)
@karthik20522
karthik20522 / gg.html
Created June 16, 2014 17:39
Photos.com OG:IMAGE
<meta property="og:url" content="http://www.photos.com/photo/481771125">
<meta property="og:image" content="http://cache1.asset-cache.net/xr/481771125.jpg?v=1&amp;c=IWSAsset&amp;k=3&amp;d=77BFBA49EF878921CC759DF4EBAC47D064EB5B867756A507549AB8612950FDC68F1BB6B36089CF16A55A1E4F32AD3138&amp;b=MjI=">
@karthik20522
karthik20522 / RetryActor.cs
Last active August 29, 2015 14:05
AKKA.NET RetryActor
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Akka.Actor;
using Akka.Event;
namespace SampleActor.Actors
{
@karthik20522
karthik20522 / ImageAnalysis.scala
Last active August 29, 2015 14:05
Image Analysis
import akka.actor.Actor
import scala.concurrent.Future
import dispatch._
import dispatch.Defaults.executor
import akka.actor.OneForOneStrategy
import akka.actor.SupervisorStrategy.Escalate
import org.openimaj.image.{ MBFImage, ImageUtilities }
import java.io.ByteArrayInputStream
import com.p.models.{ RequestAnalysis, HttpException }
import java.net.ConnectException
@karthik20522
karthik20522 / upgrade_rmq.sh
Created January 15, 2015 18:42
upgrade_rmq
function check_rmq_version {
rmq_version=$(sudo rabbitmqctl status | grep "rabbit," | cut -d',' -f3 | cut -d'}' -f1 | tr -d '"')
echo && echo " Version = $rmq_version" && echo
}
function stop_rmq {
echo "Stopping RabbitMQ..."
sudo service rabbitmq-server stop
}
@karthik20522
karthik20522 / sampl-xmp.xml
Created January 20, 2015 19:27
sampl-xmp.xml
$ exiftool.exe -xmp:all -g1 -json ../457180206.jpg
[{
"SourceFile": "../457180206.jpg",
"XMP-x": {
"XMPToolkit": "XMP Core 4.1.1"
},
"XMP-photoshop": {
"CaptionWriter": "/ma",
"DateCreated": "2014:11:11 23:10:00-05:00",
"AuthorsPosition": "Stringer",
@karthik20522
karthik20522 / es_upgrade.sh
Last active January 27, 2016 15:42
es_upgrade in place
curl -X POST http://localhost:9200/_cluster/nodes/_local/_shutdown
wget https://download.elasticsearch.org/elasticsearch/release/org/elasticsearch/distribution/tar/elasticsearch/2.1.1/elasticsearch-2.1.1.tar.gz -O elasticsearch.tar.gz
tar -xf elasticsearch.tar.gz
rm elasticsearch.tar.gz
mv elasticsearch-* elasticsearch
rm -rf /usr/share/elasticsearch
mkdir /usr/share/elasticsearch
rsync -a elasticsearch/ /usr/share/elasticsearch
rm -rf /usr/share/elasticsearch/config
chmod -R 777 /usr/share/elasticsearch
{
"masterId": "450000116",
"contentId": "3a0ac8ba-0b1a-b945-9a3b-014cb8d3a14e",
"keyName": "EWSSubmission",
"transformedMetadata": {
"Caption": "TOKYO, JAPAN - MARCH 31: A business man walks under cherry blossom trees in full bloom in a park, on March 31, 2015 in Tokyo, Japan. During cherry blossom season thousands of people gather across Japan to practice 'Hanami' (Flower-viewing parties) the centuries old tradition of picnicking under a blooming Sakura tree. Hanami is said to have started during the Nara Period and still today people gather wherever cherry blossom trees are blooming and enjoy food and drinks often well into the night. As cherry blossom season coincides with the beginning of the new school year and the beginning of the business year many hanami parties are also used by companies and organizations to welcome new employees and bring staff together. The Cherry blossom season only lasts for an average of two weekends and the \\cherry blossom front\\ is forecast each year by the Ja