Skip to content

Instantly share code, notes, and snippets.

View symisc's full-sized avatar

PixLab | Symisc Systems symisc

View GitHub Profile
@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 / 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 / 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 / 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 / detect_crop_faces.php
Created March 19, 2021 01:16
Detect all human faces present in a given image via 'facedetect' and extract each one of them via 'crop' 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 present in a given image via 'facedetect' and extract each one of them via 'crop'.
*/
@symisc
symisc / detect_crop_faces.py
Last active March 19, 2021 01:15
Detect all human faces present in a given image via 'facedetect' and extract each one of them via 'crop' using the PixLab API - https://pixlab.io
import requests
import json
# Detect all human faces present in a given image via 'facedetect' and extract each one of them via 'crop'.
# Target image: Feel free to change to whatever image holding as many human faces you want
img = 'http://cf.broadsheet.ie/wp-content/uploads/2015/03/jeremy-clarkson_3090507b.jpg'
req = requests.get('https://api.pixlab.io/facedetect',params={
'img': img,
@symisc
symisc / pdftoimg.py
Created March 14, 2021 01:29
Convert a PDF document to a high resolution JPEG/PNG image via the PixLab API - https://pixlab.io/cmd?id=pdftoimg.
import requests
import json
# Convert a PDF document to JPEG/PNG image via /pdftoimg endpoint - https://pixlab.io/cmd?id=pdftoimg
req = requests.get('https://api.pixlab.io/pdftoimg',params={
'src':'https://www.getharvest.com/downloads/Invoice_Template.pdf',
'export': 'jpeg',
'key':'PIXLAB_API_KEY' # Grab your API Key from https://pixlab.io/dashboard
})
reply = req.json()
if reply['status'] != 200:
@symisc
symisc / pdftoimg.php
Created March 14, 2021 01:28
Convert a PDF document to a high resolution JPEG/PNG image via the PixLab API - https://pixlab.io/cmd?id=pdftoimg
<?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";
# Convert a PDF document to a high resolution JPEG/PNG image via /pdftoimg.
# https://pixlab.io/cmd?id=pdftoimg for additional information.
@symisc
symisc / ocr.php
Created March 13, 2021 00:32
Given an image with human readable characters. Detect input language & extract text content from there using the PixLab API - https://pixlab.io/cmd?id=ocr
<?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";
# Given an image with human readable characters. Detect input language & extract text content from there.
# https://pixlab.io/cmd?id=ocr for additional information.
@symisc
symisc / ocr.py
Created March 13, 2021 00:29
Given an image with human readable characters. Detect input language & extract text content from there using the PixLab API - https://pixlab.io/cmd?id=ocr
import requests
import json
# Given an image with human readable characters. Detect input language & extract text content from there.
# https://pixlab.io/cmd?id=ocr for additional information.
req = requests.get('https://api.pixlab.io/ocr',params={
'img':'http://quotesten.com/wp-content/uploads/2016/06/Confucius-Quote.jpg',
'orientation':True, # Correct text orientation
'nl':True, # Output new lines if any
'key':'PIXLAB_API_KEY' # Get your API Key from https://pixlab.io/dashboard