This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import json | |
# Given two faces (eg. selfie and ID photo). Check whether they belong to the same person or not. | |
# https://pixlab.io/#/cmd?id=facecompare for additional information. | |
src = 'https://static-secure.guim.co.uk/sys-images/Guardian/Pix/pictures/2012/7/9/1341860104423/obama_face.jpg' | |
target = 'https://static01.nyt.com/images/2011/07/31/sunday-review/FACES/FACES-jumbo.jpg' | |
# Unrelated face | |
#target = 'https://s-media-cache-ak0.pinimg.com/736x/60/aa/e4/60aae45858ab6ce9dc5b33cc2e69baf7.jpg' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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"; | |
# Check whether the given faces belong to the same person or not. | |
# https://pixlab.io/#/cmd?id=facecompare for additional information. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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"; | |
# Target Image: Change to any link you want (Possibly adult) or switch to POST if you want to upload your image directly, refer to the sample set for more info. | |
$img = 'https://i.redd.it/oetdn9wc13by.jpg'; | |
# Your PixLab API Key - Get yours from https://pixlab.io/dashboard |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import json | |
# Target Image: Change to any link you want (Possibly adult) or switch to POST if you want to upload your image directly, refer to the sample set for more info. | |
img = 'https://i.redd.it/oetdn9wc13by.jpg' | |
# Your PixLab API Key - Get yours from https://pixlab.io/dashboard | |
key = 'PIXLAB_API_KEY' | |
# Blur an image according to its NSFW score | |
req = requests.get('https://api.pixlab.io/nsfw',params={'img':img,'key':key}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import json | |
# Generates a set of random pixels of desired Width & Height. This endpoint is similar to /newimage except that the image contents is filled with random pixels. This is very useful for generating background (negative) samples for feeding Machine Learning training algorithms | |
req = requests.get('https://api.pixlab.io/pixelgenerate',params={ | |
'key':'PIXLAB_API_KEY', # https://pixlab.io/dashboard to get your API Key | |
"width":300, | |
"height":300 | |
}) | |
reply = req.json() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Compile this file together with the ASCII Art source code (https://pixlab.io/art - https://github.com/symisc/ascii_art) | |
* to generate the executable. For example: | |
* | |
* gcc -W -Wall -O6 ascii_art.c sample.c -o ascii -D ART_ENABLE_STB_IMAGE | |
* ./ascii test.png | |
* | |
* ART_ENABLE_STB_IMAGE directive must be defined in order to load images from disk. | |
* Otherwise you have to rely on an external library such as OpenCV to load the target images. | |
* |