<jupyter_start><jupyter_text>Import zdjecia z internetuwyświetla zdjecie w jupyterze![] (link) ![](https://natgeo.imgix.net/syndication/d03e14b9-ccf2-40d2-9612-997a20d35b4a/magazine-rights-exempt-2016-08-departments-panda-mania-12.jpg?auto=compress,format&w=1024&h=560&fit=crop) ![](https://www.google.com/url?sa=i&source=imgres&cd=&cad=rja&uact=8&ved=2ahUKEwiFvvuM8MLhAhWHyKQKHSxsBEoQjRx6BAgBEAU&url=https%3A%2F%2Fwww.nationalgeographic.com.au%2Fanimals%2Fwho-discovered-the-panda.aspx&psig=AOvVaw2_1mzwUKFN5triJdvHotFY&ust=1554894652416632)<jupyter_code>#import zdjecia z internetu
url_img = ('https://natgeo.imgix.net/syndication/d03e14b9-ccf2-40d2-9612-997a20d35b4a/magazine-rights-exempt-2016-08-departments-panda-mania-12.jpg?auto=compress,format&w=1024&h=560&fit=crop')

response = requests.get(url_img)

#zmiana na Bytes
img = Image.open(BytesIO(response.content))

#rozmiar zdjecia 224x 224 bo taki wymaga model
img = img.resize((224,224))
img

# konwersja zdjecia na tablice o wartosciach 0-255
X = image.img_to_array(img)

#dodanie nowego wymiaru bo model przyjmuje 4 wymiary
X = np.expand_dims(X, axis =0)

#(1,,224,224,3)
#   1 - zdjecie
# 224 - rozmiar
# 224 - rozmiar
#   3 - RBG
X.shape
np.expand_dims(X, axis =0).shape
#predykcja
y_pred = model.predict(X)
#prawdopodobieństwo co jest na zdjęciu
decode_predictions(y_pred, top = 5)
#inne przypadki
url_money =('http://3.bp.blogspot.com/-CU3Mg-LeVC4/VWSAi6Ff3dI/AAAAAAAAAkM/UnHJHUkba3c/s400/IMG_9240.JPG')
url_dolar =('https://s3.amazonaws.com/ngccoin-production/us-coin-explorer-category/2718362-020o.jpg')
url_kasa =('https://ocdn.eu/pulscms-transforms/1/MesktkpTURBXy82NDZmNjk1MTExMzVmN2Q5ZmMwMWE1YjUxODU5YzdkNC5qcGeSlQMAAM0QbM0JPZMFzQNSzQHe')
url_snow =('https://miastodzieci.pl/wp-content/uploads/2015/09/snowman-1073800_1920.jpg') 
url_dolares = ('https://wf2.xcdn.pl/files/17/04/12/984916_hI4O_17123251389_bed3c3a1ba_b_83.jpg')
url_cash = ('http://m.wm.pl/2018/07/orig/pieniadze-22-482228.jpg')

response = requests.get(url_cash)
img = Image.open(BytesIO(response.content))

#rozmiar zdjecia 224x 224
img = img.resize((224,224))
img
X = image.img_to_array(img)
X = np.expand_dims(X, axis =0)
X.shape
#predykcja
y_pred = model.predict(X)
#prawdopodobieństwo co jest na zdjęciu
decode_predictions(y_pred, top = 5)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14483354950281022, 'fraction_numerical': 0.10635538261997406, 'mean_word_length': 6.687707641196013, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 7, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 1, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '446999', 'license': 'MIT', 'n_tokens_mistral': 1249, 'n_tokens_neox': 1096, 'n_words': 121, 'path': 'part2/day2/day2 - pandas image.ipynb', 'repo_name': 'toskpl/Challenge_DW', 'size': '2313'}