def __init__(self, api_key): self.api_key = api_key self.workspace = fdc.Workspace(api_key) self.run_id = -1 # defaults to error value self.scenes = self.workspace.get_scenes() self.canceled = False self.scene_num = -1
def main(): global workspace global strategy print("Enter the id of the scene you would like to test") strategies = ["multi", "natural"] scene_id = input("id? ") strategy = input("strategy? ") while not strategy in strategies: print("Invalid strategy\n") strategy = input("strategy? ") api_key = 'MaH!2iNyY1C3vfyusR%?FmDu@!mZMl9Ns8Syby?9ZPB*rJ&X$b^0fCduWj_$&9m7' workspace = fdc.Workspace(api_key) scenes = workspace.get_scenes() # Check if scene id is a valid scene for scene in scenes: if (scene['id'] == int(scene_id)): start_run(scene)
import firedrone.client as fdc from firedrone.client.errors import FireDroneClientHttpError import os api_key = 'MaH!2iNyY1C3vfyusR%?FmDu@!mZMl9Ns8Syby?9ZPB*rJ&X$b^0fCduWj_$&9m7' workspace = fdc.Workspace(api_key) scenes = workspace.get_scenes()
#run this file to get a runId #insert runID into scene%d.py import firedrone.client as fdc from firedrone.client.errors import FireDroneClientHttpError workspace = fdc.Workspace('') #workspace.directrun_end('') #Insert scene number try: start_result = workspace.directrun_start(21) print(start_result) except FireDroneClientHttpError as e: print(e)
import firedrone.client as fdc from firedrone.client.errors import FireDroneClientHttpError import os import tensorflow as tf import numpy as np import cv2 import json RETRAINED_LABELS_TXT_FILE_LOC = os.getcwd() + "/" + "retrained_labels.txt" RETRAINED_GRAPH_PB_FILE_LOC = os.getcwd() + "/" + "retrained_graph.pb" DATA_DIR = os.getcwd() + "/drone" workspace = fdc.Workspace( '7#ogORpZ1j9CRAT$-AYVoG4SgVXnkjf&rC6Xg2kADk^ece-_gM9X5bp1HXA%%C!S') runId = '' classifications = ['fire', 'nofire'] # Move left once to get MOVE_RESULT in order to start the loop move_result = workspace.directrun_move_left(runId) # move drone to the bottom left corner move_result['success'] = True while move_result['success']: move_result = workspace.directrun_move_left(runId) # ___________________________________________________________ # Drone at the bottom left corner. Ready to start work row = 0 move_result['success'] = True # load the graph from file with tf.gfile.FastGFile(RETRAINED_GRAPH_PB_FILE_LOC, 'rb') as retrainedGraphFile: