X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?p=flatland.git;a=blobdiff_plain;f=README.md;h=c1ff0a278434c5f5a2e28b0c42b77884e51c0d79;hp=340eee4d5ab1157fea181117b2079a7e7fc6c689;hb=db40d75f91d5d332b475a260df8c034103159286;hpb=d344c0240192c6fbe27ddd30c3c209e21e117c64 diff --git a/README.md b/README.md index 340eee4..c1ff0a2 100644 --- a/README.md +++ b/README.md @@ -3,10 +3,41 @@ This is an implementation of a simple 2d physics simulator usable from the pytorch framework. +The main function is + +``` +torch.ByteTensor 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) +``` +with + + * `pulling` indicating if one of the shape should be pulled upward, + * `nb_sequences` the number of sequences to generate + * `nb_images` the number of frames per sequence + * `image_height` an `image_width` the individual image size + * `nb_shapes` how many rectangular shapes to put in the simulation + * `random_shape_size` should they be of different size + * `random_colors` should they be of different colors + +The returned ByteTensor has five dimensions: + + * Sequence index + * Image index + * Channel (3, as for 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 +./flatland-test.py ```