This file contains 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
""" | |
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 --' |
This file contains 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
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 |
This file contains 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
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' |
This file contains 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
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)) |