Minor changes
This commit is contained in:
@@ -22,7 +22,7 @@ class Configuration:
|
|||||||
board.Card]],
|
board.Card]],
|
||||||
meta: Dict[str,
|
meta: Dict[str,
|
||||||
str]) -> None:
|
str]) -> None:
|
||||||
self.adjustment = adj
|
self.field_adjustment = adj
|
||||||
self.catalogue = catalogue
|
self.catalogue = catalogue
|
||||||
self.meta = meta
|
self.meta = meta
|
||||||
|
|
||||||
@@ -33,12 +33,12 @@ class Configuration:
|
|||||||
zip_file.writestr(
|
zip_file.writestr(
|
||||||
self.ADJUSTMENT_FILE_NAME, json.dumps(
|
self.ADJUSTMENT_FILE_NAME, json.dumps(
|
||||||
dataclasses.asdict(
|
dataclasses.asdict(
|
||||||
self.adjustment)))
|
self.field_adjustment)))
|
||||||
counter = 0
|
counter = 0
|
||||||
for square, card in self.catalogue:
|
for square, card in self.catalogue:
|
||||||
counter += 1
|
counter += 1
|
||||||
file_stream = io.BytesIO()
|
file_stream = io.BytesIO()
|
||||||
np.save(file_stream, square, allow_pickle=False)
|
np.save(file_stream, card_finder.simplify(square)[0], allow_pickle=False)
|
||||||
file_name = ""
|
file_name = ""
|
||||||
if isinstance(card, board.SpecialCard):
|
if isinstance(card, board.SpecialCard):
|
||||||
file_name = f's{card.value}-{card.name}-{counter}.npy'
|
file_name = f's{card.value}-{card.name}-{counter}.npy'
|
||||||
|
|||||||
@@ -21,7 +21,8 @@ def main() -> None:
|
|||||||
nparr = np.frombuffer(img_str, np.uint8)
|
nparr = np.frombuffer(img_str, np.uint8)
|
||||||
image = cv2.imdecode(nparr, cv2.IMREAD_COLOR)
|
image = cv2.imdecode(nparr, cv2.IMREAD_COLOR)
|
||||||
|
|
||||||
Configuration.generate(image)
|
a = Configuration.generate(image)
|
||||||
|
a.save('test_config.zip')
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
Reference in New Issue
Block a user