from markov.metrics.s3_metrics import EvalMetrics from markov.metrics.s3_writer import S3Writer from markov.metrics.iteration_data import IterationData from markov.metrics.constants import MetricsS3Keys, IterationDataLocalFileNames, ITERATION_DATA_LOCAL_FILE_PATH from markov.s3_boto_data_store import S3BotoDataStore, S3BotoDataStoreParameters from markov.s3_client import SageS3Client from markov.sagemaker_graph_manager import get_graph_manager from markov.rollout_utils import PhaseObserver, signal_robomaker_markov_package_ready from markov.rospy_wrappers import ServiceProxyWrapper from markov.camera_utils import configure_camera from markov.utils_parse_model_metadata import parse_model_metadata from markov.checkpoint_utils import TEMP_RENAME_FOLDER, wait_for_checkpoints, modify_checkpoint_variables from std_srvs.srv import Empty, EmptyRequest logger = Logger(__name__, logging.INFO).get_logger() EVALUATION_SIMTRACE_DATA_S3_OBJECT_KEY = "sim_inference_logs/EvaluationSimTraceData.csv" MIN_RESET_COUNT = 10000 #TODO: change when console passes float("inf") CUSTOM_FILES_PATH = "./custom_files" if not os.path.exists(CUSTOM_FILES_PATH): os.makedirs(CUSTOM_FILES_PATH) if not os.path.exists(TEMP_RENAME_FOLDER): os.makedirs(TEMP_RENAME_FOLDER) def evaluation_worker(graph_manager, number_of_trials, task_parameters, s3_writers, is_continuous): """ Evaluation worker function
'''This module houses all the constants for the metrics package''' from enum import Enum, unique from collections import OrderedDict import os import logging from markov.log_handler.logger import Logger LOG = Logger(__name__, logging.INFO).get_logger() class MetricsS3Keys(Enum): '''The keys fro the s3 buckets''' REGION = 'aws_region' METRICS_BUCKET = 'metrics_bucket' METRICS_KEY = 'metrics_key' ENDPOINT_URL = 'endpoint_url' class EvalMetricsKeys(Enum): '''The shared metric key for eval metrics''' PROGRESS = 'progress' class StepMetrics(Enum): '''The keys for the sim trace metrics''' EPISODE = 'episode' STEPS = 'steps' X = 'X' Y = 'Y' YAW = 'yaw' STEER = 'steer'
def test_get_logger(): """The test function checks if the Logger is instantiated properly. """ log = Logger(__name__, logging.INFO).get_logger() assert isinstance(log, logging.Logger)
from markov.reset.constants import (RaceType) from markov.rospy_wrappers import ServiceProxyWrapper from markov.utils import get_racecar_idx from deepracer_simulation_environment.srv import VideoMetricsSrvRequest, VideoMetricsSrv from mp4_saving.constants import (RaceCarColorToRGB, CameraTypeParams, Mp4Parameter, FrameQueueData, MAX_FRAMES_IN_QUEUE, KVS_PUBLISH_PERIOD, QUEUE_WAIT_TIME, FrameTypes) from mp4_saving.single_agent_image_editing import SingleAgentImageEditing from mp4_saving.multi_agent_image_editing import MultiAgentImageEditing from mp4_saving.training_image_editing import TrainingImageEditing from mp4_saving.f1_image_editing import F1ImageEditing from mp4_saving import utils from mp4_saving.save_to_mp4 import SaveToMp4 LOG = Logger(__name__, logging.INFO).get_logger() class AgentsVideoEditor(object): """ This node is used to produce frames for the AWS kinesis video stream and for saving the mp4 and uploading to S3. Both are subscribed to the output of the image topic produced by this node. """ _agents_metrics = list() _mp4_queue = list() def __init__(self, racecar_name, racecars_info, is_publish_to_kvs_stream): # # We have no guarantees as to when gazebo will load the model, therefore we need # to wait until the model is loaded and markov packages has spawned all the models #