Skip to content

Commit cde88df

Browse files
committed
succesful packaging
1 parent 3752f0f commit cde88df

File tree

14 files changed

+62
-1
lines changed

14 files changed

+62
-1
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,15 @@ Generate and load dataset of road network maps.
55
* Use pip to install necessary python packages `pip install -r requirements.txt`.
66
* Run `python run.py` script. It will store .dill files in the data/output/ directory.
77
* These dill files can be read using the `ImgGroupReader` object in `read.py`. Run `read.py` to run a small test for the same.
8+
9+
10+
# Installation from pip
11+
12+
```
13+
pip install mapdatasetgenerator
14+
```
15+
16+
# Usage
17+
```
18+
import mapdataset
19+
```

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ include = [
1515
]
1616

1717
packages = [
18-
{include="MapDatasetGenerator", from="./src"}
18+
{include="mapdataset", from="./src"}
1919
]
2020

2121
[tool.poetry.dependencies]

read.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Script to read dill data objects as numpy arrays.
2+
import dill
3+
import numpy as np
4+
from PIL import Image
5+
import os
6+
7+
from mapdataset import ImageGroupReader
8+
9+
10+
dillFolder = "./data/output/SF_Layered/32x32/stride-10"
11+
nGroups = 0
12+
# Iterate directory
13+
for path in os.listdir(dillFolder):
14+
# check if current path is a file
15+
if os.path.isfile(os.path.join(dillFolder, path)) and path.endswith(".dill"):
16+
nGroups += 1
17+
18+
for i in range(nGroups):
19+
reader = ImageGroupReader(dillFolder)
20+
data = reader.load_group(groupNo=i)
21+
patchImgArray = reader.asImg(data[0])
22+
im = Image.fromarray(patchImgArray)
23+
path = os.path.join(dillFolder, f"{i}-0.png")
24+
im.save(path)

src/MapDatasetGenerator/__init__.py

Whitespace-only changes.

src/mapdataset/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from .lib import *
File renamed without changes.

0 commit comments

Comments
 (0)