Scripts
Graphs
Datadynamics contains several scripts to generate graphs and point labels from image files to use in the graph_collector
environment.
Generate Graphs From Masks
Script to generate input graphs to the graph_collector_v0 environment.
This script generates a graph with a grid-like structure from an obstacle mask file. Obstacles are encoding by black as default. The input obstacle mask file should be a binary image or an image that can be converted to one. The file should be a mask that represents the obstacles in the grid-like environment that the agent cannot traverse through.
main(args)
Generate graph from obstacle mask file.
Example usage: python -m datadynamics.scripts.graph.generate_graph -i ./data/obstacle_mask.png -o ./data/graph.pkl -m ./data/metadata.json -rs 100 100 -dfw 1.0
Source code in scripts/graph/generate_graph.py
Generate Point Labels From Masks
Script to generate point labels for the graph_collector_v0 environment.
This script generates point labels used to represent points in a grid-like environment structure from a point mask file. Points are encoding by black as default. The input point mask file should be a binary image or an image that can be converted to one.
main(args)
Generate point labels from point mask file.
Example usage: python -m datadynamics.scripts.graph.generate_points -i ./data/point_mask.png -o ./data/point_labels.pkl -rs 100 100