Skip to content

Commit

Permalink
Update README & libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
ppizarror committed Aug 12, 2024
1 parent f4f3594 commit 0d0906d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
4 changes: 2 additions & 2 deletions MLStructFP/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
# Basic information
__author__ = 'Pablo Pizarro R.'
__description__ = 'Machine learning structural floor plan dataset'
__keywords__ = ['ml', 'ai', 'dataset', 'calc', 'matrix analysis', 'cnn', 'structural analysis', 'structural design']
__keywords__ = ['ml', 'ai', 'floor-plan', 'architectural', 'dataset', 'cnn']
__email__ = '[email protected]'
__version__ = '0.5.9'
__version__ = '0.6.0'

# URL
__url__ = 'https://github.com/MLSTRUCT/MLSTRUCT-FP'
Expand Down
12 changes: 8 additions & 4 deletions MLStructFP/db/image/_rect_binary.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@
class RectBinaryImage(BaseImage):
"""
Rect binary image.
This class creates a segmentation mask iterating all rects from a given floor;
obviously, this can be further extended to create other maps, for example, for
wall joints (points), or can be concatenated to create multiple mask tensor for
a given crop (like wall segments + joints). It is up to your imagination and
technical abilities =). I'd say that this is the most important class of all.
"""
_crop_px: int
_initial_backend: str
Expand All @@ -53,7 +59,7 @@ def __init__(
:param path: Image path
:param save_images: Save images on path
:param image_size_px: Image size (width/height), bigger images are expensive, double the width, quad the size
:param image_size_px: Image size (width/height), bigger images are expensive; double the width, quad the size
"""
BaseImage.__init__(self, path, save_images, image_size_px)
self._crop_px = int(math.ceil(self._image_size / 32)) # Must be greater or equal than zero
Expand Down Expand Up @@ -82,7 +88,6 @@ def _get_floor_plot(self, floor: 'Floor', rect: Optional['Rect'], store: bool) -
:return: Figure of the floor
"""
floor_id = str(floor.id)

if floor_id in self._plot.keys():
return self._plot[floor_id]

Expand Down Expand Up @@ -138,7 +143,7 @@ def _convert_image_color(self, im: 'Image.Image') -> 'Image.Image':
:param im: Image
:return: Converted image
"""
return im.convert('P', palette=Image.ADAPTIVE)
return im.convert('P', palette=Image.Palette.ADAPTIVE)

# noinspection PyMethodMayBeStatic
def _post_process(self, im: 'Image.Image') -> 'Image.Image':
Expand Down Expand Up @@ -200,7 +205,6 @@ def make_region(self, xmin: NumberType, xmax: NumberType, ymin: NumberType, ymax
assert self._path != '', 'Path cannot be empty'
filesave = os.path.join(self._path, figname + '.png')
im4.save(make_dirs(filesave), format='PNG')
# print('Rect {0} saved to {1}'.format(rect.id, filesave))

# noinspection PyTypeChecker
array = np.array(im4, dtype=TYPE_IMAGE)
Expand Down
3 changes: 2 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ scaling.
The images can be generated from the real rasterized plan, or by using the polygons stored in the
JSON file. Both image and wall polygons are consistent in their placement.

See more information in our `published article <https://doi.org/10.1016/j.autcon.2023.105132>`_.
See more information in our `published article <https://doi.org/10.1016/j.autcon.2023.105132>`_; also,
check out the `AI segmentation model <https://github.com/MLSTRUCT/MLSTRUCT-FP_benchmarks>`_ that tests this dataset.


First steps
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
'numpy >= 1.18.5',
'opencv-python <= 4.5.3.56',
'Pillow >= 10.4.0',
'plotly >= 5.22.0',
'plotly >= 5.23.0',
'requests >= 2.32.3',
'tabulate >= 0.9.0'
]
Expand Down

0 comments on commit 0d0906d

Please sign in to comment.