X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?p=flatland.git;a=blobdiff_plain;f=README.md;h=d6e302caa8068552216f9a9c8b7bb894144b1552;hp=3154c173e378983a8bbbfa155963392af61ab9d2;hb=HEAD;hpb=440654efec7784239bdb56ea08fb315583418cea diff --git a/README.md b/README.md index 3154c17..d6e302c 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,43 @@ +# Introduction # + +This is an implementation of a simple 2d physics simulator usable from +the pytorch framework. + +The main function is + +``` +torch.ByteTensor flatland.generate_sequence(bool pulling, + int nb_sequences, + int nb_images, + int image_height, int image_width, + int nb_shapes, + bool random_shape_size, bool random_colors) +``` + +where + + * `pulling` indicates if one of the shape should be pulled upward, + * `nb_sequences` is the number of sequences to generate, + * `nb_images` is the number of frames per sequence, + * `image_height` and `image_width` is the individual image size, + * `nb_shapes` is the number of rectangular shapes in the simulation, + * `random_shape_size` states if the shapes should be of different sizes, + * `random_colors` states if they should be of different colors. + +The returned ByteTensor has five dimensions: + + * Sequence index + * Image index + * Channel (3 since it is RGB) + * Pixel row + * Pixel col + +Warning: For improper parameters values (e.g. too many shapes, too +small images), the simulation may be stuck. + # Installation and test # ``` make -j -k -./built.py -./flatland-test.py --nb_sequences 5 --nb_shapes 6 --nb_images_per_sequence 20 +./test-flatland.py ```