Skip to content

Instantly share code, notes, and snippets.

View symisc's full-sized avatar

PixLab | Symisc Systems symisc

View GitHub Profile
@symisc
symisc / tag_img.php
Created March 23, 2021 01:09
Tag an image based on detected visual content using the PixLab API - https://pixlab.io/cmd?id=tagimg
<?php
/*
* PixLab PHP Client which is just a single class PHP file without any dependency that you can get from Github
* https://github.com/symisc/pixlab-php
*/
require_once "pixlab.php";
# Tag an image based on detected visual content which mean running a CNN on top of it.
# https://pixlab.io/#/cmd?id=tagimg for more info.
@symisc
symisc / tag_img.py
Last active May 4, 2022 05:24
Tag (Generate a description of) an image based on detected visual content using the PixLab API - https://pixlab.io/cmd?id=tagimg
import requests
import json
# Generates a description of an image in human readable language with complete sentences.
# The description is based on the visual content as reported by our state-of-the-art image labeling algorithm.
# More than one description can be generated for each image. Descriptions are ordered by their confidence score.
# https://pixlab.io/cmd?id=tagimg for the official documentation.
# Target Image: Change to any link or switch to POST if you want to upload your image directly, refer to the sample set for more info.
img = 'https://s-media-cache-ak0.pinimg.com/originals/35/d0/f6/35d0f6ee0e40306c41cfd714c625f78e.jpg'
@symisc
symisc / generate_gif.py
Created March 23, 2021 01:24
Generate a GIF file from a set of static image using the PixLab API - https://pixlab.io/cmd?id=makegif
import requests
import json
# Generate GIF file from a set of static image - https://pixlab.io/cmd?id=makegif
req = requests.post(
'https://api.pixlab.io/makegif',
headers={
'Content-Type':'application/json'
},data=json.dumps({
@symisc
symisc / generate_gif.php
Last active March 23, 2021 01:32
Generate a GIF file from a set of static image using the PixLab API - https://pixlab.io/cmd?id=makegif
<?php
/*
* PixLab PHP Client which is just a single class PHP file without any dependency that you can get from Github
* https://github.com/symisc/pixlab-php
*/
require_once "pixlab.php";
# Generate GIF from a set of static image - https://pixlab.io/cmd?id=makegif
$key = 'PIXLAB_API_KEY'; # # Your PixLab API Key. Get yours from https://pixlab.io/dashboard
@symisc
symisc / mimic_snapchat_filters.php
Created March 25, 2021 01:09
Mimic the famous Snapchat filters in PHP using the PixLab API - https://pixlab.io
<?php
/*
* PixLab PHP Client which is just a single class PHP file without any dependency that you can get from Github
* https://github.com/symisc/pixlab-php
*/
require_once "pixlab.php";
# Detect all human faces & extract their landmark regions via facelandmarks & make a small Snapchat filter effect.
# Only three commands are actually needed in order to mimic the Snapchat filters effects:
# face landmarks: https://pixlab.io/cmd?id=facelandmarks
@symisc
symisc / find_face_crowd.py
Created March 27, 2021 01:46
Find a person's face in a crowd or group of people using the PixLab API - https://pixlab.io/cmd?id=facelookup
import requests
import json
# Find a person's face in a crowd or group of people. https://pixlab.io/cmd?id=facelookup for additional information.
# This is the target face we are looking for.
face = 'http://static-secure.guim.co.uk/sys-images/Guardian/Pix/pictures/2012/7/9/1341860104423/obama_face.jpg'
# The people crowd to look on
crowd = 'http://www.acclaimimages.com/_gallery/_free_images/0519-0908-1001-0556_president_barack_obama_walking_with_a_crowd_of_people_o.jpg'
@symisc
symisc / find_face_crowd.php
Created March 27, 2021 01:49
Find a person's face in a crowd or group of people using the PixLab API - https://pixlab.io/cmd?id=facelookup
<?php
/*
* PixLab PHP Client which is just a single class PHP file without any dependency that you can get from Github
* https://github.com/symisc/pixlab-php
*/
require_once "pixlab.php";
# Find a person's face in a crowd or group of people. https://pixlab.io/cmd?id=facelookup for additional information.
# This is the target face that we are searching for in the people crowd.
@symisc
symisc / local_media_upload.php
Last active March 28, 2021 02:11
Upload a local image using the PixLab API - https://pixlab.io/cmd?id=store
<?php
/*
* PixLab PHP Client which is just a single class PHP file without any dependency that you can get from Github
* https://github.com/symisc/pixlab-php
*/
require_once "pixlab.php";
# Upload a local image to the remote https://pixlab.xyz storage server or your own S3 bucket depending on the configuration on the PixLab dashboard.
# Use the output link for other purposes such as processing via mogrify, drawrectangles, etc. or simply serving content.
# https://pixlab.io/cmd?id=store for more info.
@symisc
symisc / local_media_upload.py
Created March 28, 2021 02:12
Upload a local media file using the PixLab API - https://pixlab.io/cmd?id=store
import requests
import json
# Upload a local image to the remote https://pixlab.xyz storage server or your own S3 bucket depending on the configuration from your dashboard.
# Use the output link for other purposes such as processing via mogrify, drawrectangles, etc. or simply serving content.
# https://pixlab.io/#/cmd?id=store for more info.
req = requests.post('http://api.pixlab.io/store', # Switch to http:// for fast upload
files = {'file': open('./local_image.png', 'rb')},
data={
@symisc
symisc / gender_age_emotion_guess.py
Created March 30, 2021 22:06
Detect all human faces present in a given image and try to guess their age, gender and emotion state using the PixLab API - https://pixlab.io/cmd?id=facemotion
import requests
import json
# Detect all human faces present in a given image and try to guess their age, gender and emotion state via their facial shapes
# Target image: Feel free to change to whatever image holding as many human faces as you want
img = 'http://www.scienceforums.com/uploads/1282315190/gallery_1625_35_9165.jpg'
req = requests.get('http://api.pixlab.io/facemotion',params={
'img': img,