AI === ------ skyNet ------ Update has some tools to update databases. .. py:function:: AI/skyNet/focused_training Focused training. Train a deep learning model of cumputer vision. It will be trained over the areas of interest and the entities annotated to inference on the rest of the image. :param user: User identification :type user: str :param orthophoto: Layer pointing to orthophoto :type orthophoto: Layer :param output_layer: Layer pointing to the output result. :type output_layer: Layer :param entities: Layer pointing to the entities layer. :type entities: Layer :param aois: Layer pointing to the Area of Interes layers. :type aois: Layer :param name: Name of the model :type name: str :param zoom_levels: Zoom levels to do the training and the inference. In meters. [50, 100] will pass over the image twice with a grid of 50 meters and 100 meters. Default: [20, 40] :type zoom_levels: list :param image_max_size: Max image size in pixels of the resulted crop of the image. The images cropped by the highest zoom will have this size. :type image_max_size: int :param image_min_size: Min image size in pixels of the resulted crop of the image. The images cropped by the lowest zoom will have this size. :type image_min_size: int :param train_percentage: Percentage of image for training. The rest of images will be use for validation. :type train_percentage: float :param empty_prob: Empty probability. When generating the dataset higher values means more empty samples. :type empty_prob: float :param epochs: Number of runs over all the training images. :type epochs: int :param validation_steps: Validation steps to run at the end of each epoch. :type validation_steps: int :param transfer_learning: Activate or not the pretrained model :type transfer_learning: bool :param unfrozen_layers: Only applies if transfer learning is True. If its greater than zero the value means the percentage of unfrozen layers. If is negative means the number of unfrozen layers. :type unfrozen_layers: float :param is_annealed: Only aplies if transfer learning is True. Applies a last training step with all layers unfrozen and a very little learning rate. :type is_annealed: bool :param lr: Learning rate :type lr: float :param lr_schedule_type: Learning rate decay policy. Could be one of constant, linear, boltzman, cauchy :type lr_schedule_type: str :param lr_constant_epoch: Number of epochs after apply the decay policy. :type lr_constant_epoch: int :param data_aug: Apply or not data augmentation :type data_aug: bool :param data_aug_args: Only applies if data_aug is true. Albumentation data augmentation configuration options. :type data_aug_args: dict :param regularizer: L1 L2 Regularizer penalty. If 0 not applies :type regularizer: float :param confidence: confidence to inference new samples. :type confidence: float :returns: The result of the inference. :rtype: OutLayer .. rubric:: Examples >>> import requests >>> aois = {"ip": "192.168.1.214", ... "port": 8001, ... "protocol": 'FTP', ... "user": "test", ... "password": "test", ... "layer_name": "AOI_focused", ... "driver_type": "KML", ... "source": "/AOI_focused.kml"} >>> orthophoto = {"ip": "192.168.1.214", ... "port": 8001, ... "protocol": 'FTP', ... "user": "test", ... "password": "test", ... "layer_name": "", ... "driver_type": "GeoTIFF", ... "source": "/orto.tif"} >>> entities = {"ip": "192.168.1.214", ... "port": 8001, ... "protocol": 'FTP', ... "user": "test", ... "password": "test", ... "layer_name": "entities", ... "driver_type": "KML", ... "source": "/entities.kml"} >>> outlayer = {"ip": "192.168.1.214", ... "port": 8001, ... "protocol": 'FTP', ... "user": "test", ... "password": "test", ... "layer_name": "", ... "driver_type": "Shape", ... "source": "/result.shp"} >>> parameters={'user':'test', "aois":aoi, "orthophoto":orthophoto, "entities": entities, ... "output_layer": outlayer, 'name': 'focused_train_1', 'zoom_levels': [20, 40], ... 'image_max_size': 256, 'image_min_size': 256, 'train_percentage': 80, ... 'empty_prob': 0.5, 'epochs':20, 'validation_steps': -1, ... 'transfer_learning': True, 'unfrozen_layers': 25, 'is_annealed': True, ... 'lr': 0.0001, 'lr_schedule_type': 'linear', 'lr_constant_epoch': 5, ... 'data_aug': True, 'data_aug_args': None, 'regularizer': None, 'confidence': 0.8} >>> response = requests.post(':/AI/skyNet/new_entities', ... json=parameters) >>> response.json() {'task_id': 'XoiRl9'} .. py:function:: AI/skyNet/detection_by_entity Layer.optional() Detect new cartographic entities by orthophoto, rasterized lidar or multisensing images but selecting the entities to be detected. :param user: User ID. :type user: str :param aoi: Connection to vector source. This layer must have only one polygon and limit the action zone of the algorithm. If `aoi` is not set, the extent of the raster will be used as area of interest. :type aoi: Connection, optional :param orthophoto: Connection to ortophoto source (dir or file). :type orthophoto: Connection :param lidar: Connection to lidar source (dir or file). :type lidar: Connection, optional :param ms: Connection to multisensing imagery :type ms: Connection, optional :param output_layer: Connection to save result. :type output_layer: Connection :param entities: List of entities to detect. :type entities: list :param confident: Confident of detected entities. Default, 0.9 :type confident: float, optional :param is_optimized: True to execute a LSMS (Large Scale Mean Shift) analysis to improve geometries. Strings considered True ´['y', 'yes', 't', 'true', 'on', '1']´. Default, False. :type is_optimized: str, optional :returns: **output_layer** -- Connection where result is saved. :rtype: Connection .. rubric:: Notes - User id must by lowercase. .. rubric:: Examples >>> import requests >>> aoi = {"ip": "192.168.1.214", ... "port": 8001, ... "protocol": 'FTP', ... "user": "test", ... "password": "test", ... "layer_name": "AOI_little", ... "driver_type": "KML", ... "source": "/AOI_little.kml"} >>> orthophoto = {"ip": "192.168.1.214", ... "port": 8001, ... "protocol": 'FTP', ... "user": "test", ... "password": "test", ... "layer_name": "", ... "driver_type": "ECW", ... "source": "/ORTO"} >>> lidar = {"ip": "192.168.1.214", ... "port": 8001, ... "protocol": 'FTP', ... "user": "test", ... "password": "test", ... "layer_name": "", ... "driver_type": "GeoTIFF", ... "source": "/PointCloud"} >>> ms = {"ip": "192.168.1.214", ... "port": 8001, ... "protocol": 'FTP', ... "user": "test", ... "password": "test", ... "layer_name": "", ... "driver_type": "GeoTIFF", ... "source": "/MS"} >>> parameters={'user':'test', "aoi":aoi, "orthophoto":orthophoto, "lidar":lidar, "ms":ms, ... 'output_layer':output_layer,'entities':['elemento_construido', 'calzada_revestida_urbana']} >>> response = requests.post(':/AI/skyNet/detection_by_entity', ... json=parameters) >>> response.json() {'task_id': 'XoiRl9'} .. py:function:: AI/skyNet/detection Detect new cartographic entities by orthophoto, rasterized lidar or multisensing images :param user: User ID. :type user: str :param aoi: Connection to aoi source (KML). :type aoi: FTP Connection :param orthophoto: Connection to ortophoto source (dir or file). :type orthophoto: FTP Connection :param lidar: Connection to dem raster source. :type lidar: FTP Connection :param ms: Connection to merged sentinel images (all bands except 10, Sentinel). :type ms: FTP Connection :param output_layer: Connection to save result. :type output_layer: FTP Connection :param indexes: List of entities to detect. :type indexes: list :param model: Name of the model to use. :type model: str :param confident: Confident of detected entities. :type confident: float :returns: **output_layer** -- Connection where result is saved. If there are more than one indexes to detect the results, connection will be a ZIP connection. Inside ZIP there are one file per index detected named as {source_name}__{user}__{timestamp} :rtype: Connection .. rubric:: Notes - User id must by lowercase. - Indexes available: [edificios, piscinas] - Coming soon: carreteras dobles, carreteras únicas, torres de tendido, vías ciclistas, vías de ferrocarril ... .. rubric:: Examples >>> import requests >>> aoi = {"ip": "192.168.1.214", ... "port": 8001, ... "protocol": 'FTP', ... "user": "test", ... "password": "test", ... "layer_name": "AOI_little", ... "driver_type": "KML", ... "source": "/AOI_little.kml"} >>> orthophoto = {"ip": "192.168.1.214", ... "port": 8001, ... "protocol": 'FTP', ... "user": "test", ... "password": "test", ... "layer_name": "", ... "driver_type": "ECW", ... "source": "/ORTO"} >>> lidar = {"ip": "192.168.1.214", ... "port": 8001, ... "protocol": 'FTP', ... "user": "test", ... "password": "test", ... "layer_name": "", ... "driver_type": "GeoTIFF", ... "source": "/PointCloud"} >>> ms = {"ip": "192.168.1.214", ... "port": 8001, ... "protocol": 'FTP', ... "user": "test", ... "password": "test", ... "layer_name": "", ... "driver_type": "GeoTIFF", ... "source": "/MS"} >>> parameters={'user':'test', "aoi":aoi, "orthophoto":orthophoto, ... "lidar":lidar, "ms":ms, ... 'output_layer':output_layer,'indexes':['edificios', 'piscinas']} >>> response = requests.post(':/AI/skyNet/new_entities', ... json=parameters) >>> response.json() {'task_id': 'XoiRl9'} .. py:function:: AI/skyNet/axis_road_ai_task Función ejes viales para la funcion de IA/detection_by_entity. El ejes_viales_ia permite obtener los ejes de una capa de salida de un proceso de IA. :param task: porcentaje de la tarea en itasker :param user: USER ID :type user: str :param input_layer: Diccionario que contiene los parametros de conexión de entrada :type input_layer: dict :param output_layer: Diccionario que contiene los parametros de la capa de salida con las areas :type output_layer: dict :param output_layer_1: Diccionario que contiene los parametros de la capa de salida con los ejes :type output_layer_1: dict :param umbral: Valor de umbral :type umbral: number :param dist_buff: Distancia para el buffer, para evitar geometrias no validas. :type dist_buff: number :param simpli: Valor para la simplificación depende del tamaño del pixel :type simpli: number :param epsg_aux: Valor auxiliar a un sistemma proyectado para poder realizar el analisis :type epsg_aux: number :returns: **output_layer** -- nombre de a tabla de salida si ha sido creada :rtype: OutLayer -------- training --------