iglu.data package

Submodules

iglu.data.adapter module

class iglu.data.adapter.ActionsAdapter(hits_table=None)

Bases: object

action_space()
dialog_step(session, start=0, steps=- 1)
has_buffer()
load_session(session_name)
parse_session(path, session, start_step=0, steps=- 1, init_from_end=False, verbose=False, position=None)
parse_sessions(path, verbose=False)
render_session_video(session, visualize=False, debug=False, postprocess=True, step_callback=None, verbose=False)
Parameters
  • session (GameSession) –

  • visualize (bool, optional) – whether to render a high-resolution human friendly visualization

  • debug (bool, optional) – whether to add a debug info on each screen. Defaults to True.

  • postprocess (bool, optional) – whether to re-encode video using h264 codec. !!! REQUIRES THE LATEST FFMPEG !!!

save_session(session)
iglu.data.adapter.run(session_id=None, overwrite=False, adapt=True, render=True, visualize=False, step_callback=None)
iglu.data.adapter.run_multiprocess(session_id=None, num_workers=- 1, overwrite=False, adapt=True, render=True, visualize=False, step_callback=None)

iglu.data.common module

class iglu.data.common.GameSession(events: dict = <factory>, dialogs: list = <factory>, init_conds: dict = <factory>, name: str = None, target: numpy.ndarray = <factory>)

Bases: object

dialogs: list
episode_steps()
events: dict
init_conds: dict
name: str = None
target: numpy.ndarray
class iglu.data.common.VWEvent(kind=None, params=None, actions=None, grid=None, camera=None, position=None, step=None, turn=None)

Bases: object

iglu.data.download module

class iglu.data.download.BlobFileDownloader(local_blob_path=None)

Bases: object

download_blobs_in_container(prefix)
list_blobs()
iglu.data.download.download(directory=None, raw_data=False)

iglu.data.parse module

class iglu.data.parse.ActionsParser(action_space)

Bases: object

action(action_type, *args, n=0, g=0, **kwargs)
block_change(*args, n=0, g=0, **kwargs)
new_event(kind, params, actions, grid=None, gridUpdate=None, camera=None, position=None, step=None, turn=None)
parse(sourcefile, g=0, last=False)
parse_init_conds(data, position=None)
parse_one(line, n=0, g=0)
pos_change(*args, n=0, g=0, **kwargs)
render_callback(event, i, k, output, obs, reward, done, info)
reset()
set_look(*args, n=0, g=0, **kwargs)
iglu.data.parse.fix_log(log_string)
log_string: str

log_string should be a string of the full log. It should be multiple lines, each corresponded to a timestamp, and should be separated by newline character.

iglu.data.parse.fix_xyz(x, y, z)

iglu.data.pipeline module

class iglu.data.pipeline.IGLUDataPipeline(data_directory: <module 'posixpath' from '/home/artem/.conda/envs/sphinx/lib/python3.7/posixpath.py'>, num_workers: int, worker_batch_size: int, min_size_to_dequeue: int, random_seed=42)

Bases: minerl_patched.data.data_pipeline.DataPipeline

get_file_dir(stream_name)
classmethod get_worker()
classmethod postprocess_batches(batches)
classmethod read_files(file_dir)
iglu.data.pipeline.iglu_job(arg)

iglu.data.render module

class iglu.data.render.Renderer(width, height, h264=False, fps=60)

Bases: object

create_env(external_env=None, task_target=None)
init_conditions(init_pos, init_blocks)
postproc_video(output)
postprocess_frame(frame, render_debug=False, render_text=False, render_crosshair=False, text=None, **kwargs)
put_multiline_text(lines, height, width)
render_screenshots(writefile)
render_video(output, event_sequence, init_conds=None, on_env_step=None, render_text=False, text=None, render_crosshair=False, render_debug=False, reset=True, close=True, writer=None, verbose=False)

Module contents

iglu.data.make(data_dir=None, num_workers=4, worker_batch_size=32, minimum_size_to_dequeue=32, force_download=False)

Initalizes the data loader with the chosen environment

Parameters
  • environment (string) – desired MineRL environment

  • data_dir (string, optional) – specify alternative dataset location. Defaults to None.

  • num_workers (int, optional) – number of files to load at once. Defaults to 4.

  • force_download (bool, optional) – specifies whether or not the data should be downloaded if missing. Defaults to False.

Returns

initalized data pipeline

Return type

DataPipeline