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 os | |
| import json | |
| import requests | |
| from requests.auth import HTTPBasicAuth | |
| # API Key stored as an env variable | |
| PLANET_API_KEY = os.getenv('PL_API_KEY') # replace PL_API_KEY with Planet API key in quotes | |
| item_type = "PSScene4Band" |
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
| download_link = activation_status_result.json()["location"] | |
| print(download_link) | |
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
| links = result.json()[u"analytic"]["_links"] | |
| self_link = links["_self"] | |
| activation_link = links["activate"] | |
| # Request activation of the 'analytic' asset: | |
| activate_result = \ | |
| requests.get( | |
| activation_link, | |
| auth=HTTPBasicAuth(PLANET_API_KEY, '') |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| def plot_image(i, predictions_array, true_label, img): | |
| predictions_array, true_label, img = predictions_array[i], true_label[i], img[i] | |
| plt.grid(False) | |
| plt.xticks([]) | |
| plt.yticks([]) | |
| plt.imshow(img, cmap=plt.cm.binary) | |
| predicted_label = np.argmax(predictions_array) | |
| if predicted_label == true_label: |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.