Skip to content

Instantly share code, notes, and snippets.

View xorwen's full-sized avatar

Ondřej Veselý xorwen

View GitHub Profile
@xorwen
xorwen / plant_id_api_usage.py
Last active December 10, 2022 08:50
How to work with plant.id API
"""
The purpose of this code is to show how to work with plant.id API.
You'll find API documentation at https://plantid.docs.apiary.io and https://plant.id/api
"""
import base64
import requests
from time import sleep
secret_access_key = '-- ask for one at business@plant.id --'
def predict_conclusions_num(judikat=None,
field2_month=None,
field2_day_of_month=None):
""" Predictor for conclusions from model/59ec8e4aaf447f0b19000092
Predictive model by BigML - Machine Learning Made Easy
"""
import re
def predict_conclusion(judicat=None):
""" Predictor for conclusion from model/59ec825249c4a1477200017c
Predictive model by BigML - Machine Learning Made Easy
"""
import re
tm_tokens = 'tokens_only'
tm_full_term = 'full_terms_only'
@xorwen
xorwen / loader.py
Created October 17, 2017 11:45
Load gvc-aircraft-2013b dataset into numpy structure
from PIL import Image, ImageOps
import numpy as np
dataset_path='fgvc-aircraft-2013b/data'
def load_image( infilename ):
img = Image.open( infilename ).convert('L')
img.load()
(width, height) = (img.size)
img.crop((0, 0, width, height - 20))