dannydeezy / mosaics

Community generated recursive mosaic inscriptions
MIT License
8 stars 5 forks source link

some error DL slug #2

Closed spzjulien closed 1 year ago

spzjulien commented 1 year ago

spzjulien@spzjulien-System-Product-Name: mosaics python3 download-inscriptions.py banksy2 Downloading inscriptions for banksy2 https://raw.githubusercontent.com/ordinals-wallet/ordinals-collections/main/collections/banksy2/inscriptions.json Image sucessfully Downloaded: images/banksy2/092630a676d7c161e463b939f87726dca7c66bd1af74483075827f42da642c25i0 Image sucessfully Downloaded: images/banksy2/0561dd62b15b406b38434cd700474fd025fcb353bc3e51d488082d6f6c615b18i0 Image sucessfully Downloaded: images/banksy2/13f3ce50d8e7a338fb0e5d5ba8054c6288d5554feec154731b075217d94bf205i0 Image sucessfully Downloaded: images/banksy2/fcf8b5aeb4b5d0431250b423c6ab2bdd9e5c141d4b7a0f5c95c2a695af30a197i0 Image sucessfully Downloaded: images/banksy2/bf119a6be1953c62f87e6067f17a2aac5107c5364af0a310dda30024890593a6i0 Image sucessfully Downloaded: images/banksy2/a38e8b368dbc911647a93490ced283615642b5205bb110e103026331f3c0e468i0 Image sucessfully Downloaded: images/banksy2/370eefc5469430ce77678187c38d2ea046d99ab596d381aad94315bee2314c3ei0 Image sucessfully Downloaded: images/banksy2/f2880adbdd1975828c72d9e5ff025ab42fceedf9f03799e20eb7b35e4294f6d6i0 Image sucessfully Downloaded: images/banksy2/c85fb2f4edf83bdaef85682713231ac6d2b4eaf038c0a0ba2dabd350eedaab0ei0 Image sucessfully Downloaded: images/banksy2/4a6d5ba407b25f18083ca46b80cecc663f304627cc9fcaaef624424017de98edi0 Image sucessfully Downloaded: images/banksy2/db520a514ec786673e7a5e3ba0f4f522ee2ce242ef7307b2771a80d4dda56fb0i0 Image sucessfully Downloaded: images/banksy2/aa83fb470deb77e2d43a050726d5fdce9f3d89abfe49a1a816814889630017a9i0 banksy2 12 making dir: collections/banksy2 Calculating average colors for banksy2... spzjulien@spzjulien-System-Product-Name:mosaics python3 download-inscriptions.py banksy Downloading inscriptions for banksy https://raw.githubusercontent.com/ordinals-wallet/ordinals-collections/main/collections/banksy/inscriptions.json Traceback (most recent call last): File "/home/spzjulien/mosaics/download-inscriptions.py", line 72, in download_inscriptions(slugs) File "/home/spzjulien/mosaics/download-inscriptions.py", line 38, in download_inscriptions data = json.loads(resp.text) File "/usr/lib/python3.10/json/init.py", line 346, in loads return _default_decoder.decode(s) File "/usr/lib/python3.10/json/decoder.py", line 340, in decode raise JSONDecodeError("Extra data", s, end) json.decoder.JSONDecodeError: Extra data: line 1 column 4 (char 3)

dannydeezy commented 1 year ago

hey @spzjulien it looks like the banksy slug is not in the ordinals-wallet collection registry: https://raw.githubusercontent.com/ordinals-wallet/ordinals-collections/main/collections/banksy/inscriptions.json

dannydeezy commented 1 year ago
Screenshot 2023-07-13 at 3 08 29 PM
spzjulien commented 1 year ago
Screenshot 2023-07-13 at 3 08 29 PM

yeah true they edit/changed name on some older collection, at some point ! thanks

spzjulien commented 1 year ago

i still have issue, freeze at 100% process python3 mosaic.py 22.png banksy2 "SpZ gorilla" Processing main image... Main image processed. Reading tiles from images/banksy2... Processed 12 tiles.5d0431250b423c6ab2bdd9e5c141d 0561dd62b15b406b38434cd700474fd025fcb353bc3e51d488082d6f6c615b18i0 Building mosaic, press Ctrl-C to abort... Process Process-1: Traceback (most recent call last): File "/usr/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap self.run() File "/usr/lib/python3.10/multiprocessing/process.py", line 108, in run self._target(*self._args, **self._kwargs) File "/home/spzjulien/mosaics/mosaic.py", line 381, in build_mosaic tile_data = all_tile_data_large[best_fit_tile_index] TypeError: list indices must be integers or slices, not NoneType Progress: 100.0%

dannydeezy commented 1 year ago

@spzjulien the problem here is that you're hitting the constraint on line 18 which enforces that a single tile can only appear a maximum of 10 times. looks like the banksy collection you're using only has a few items, but there need to be 10k tiles in the mosaic.

good news - you can get around it temporarily by editing line 18 to increase the MAX_OCCURENCES_PER_TILE to something much bigger like 2000 or even 10000. worth trying just to get a sense. but i would encourage you to find more collections to use that have more items to choose from so that the mosiac has many different diverse tiles

spzjulien commented 1 year ago

all good now ! thanks @dannydeezy

spzjulien commented 1 year ago

all good