yobeatz / mosaic Goto Github PK
View Code? Open in Web Editor NEWGenerate Roman style mosaics from input images
License: MIT License
Generate Roman style mosaics from input images
License: MIT License
C:\Users\LENOVO\Desktop\mosaic-main>py mosaic.py
Size of input image: 600px * 900px
Estimated number of tiles: 1875
C:\Users\LENOVO\Desktop\mosaic-main\edges.py:108: FutureWarning: `multichannel` is a deprecated argument name for `gaussian`. It will be removed in version 1.0. Please use `channel_axis` instead.
img = filters.gaussian(img, sigma=16, truncate=gauss/16, multichannel=True)
Pixel guidelines to chains with sorted points: 0.3s
Calculation of angle matrix: 0.9s
C:\Users\LENOVO\Desktop\mosaic-main\tiles.py:20: ShapelyDeprecationWarning: The 'type' attribute is deprecated, and will be removed in the future. You can use the 'geom_type' attribute instead.
if p.type not in ['MultiLineString','LineString', 'GeometryCollection']:
C:\Users\LENOVO\Desktop\mosaic-main\tiles.py:20: ShapelyDeprecationWarning: The 'type' attribute is deprecated, and will be removed in the future. You can use the 'geom_type' attribute instead.
if p.type not in ['MultiLineString','LineString', 'GeometryCollection']:
C:\Users\LENOVO\Desktop\mosaic-main\tiles.py:20: ShapelyDeprecationWarning: The 'type' attribute is deprecated, and will be removed in the future. You can use the 'geom_type' attribute instead.
if p.type not in ['MultiLineString','LineString', 'GeometryCollection']:
C:\Users\LENOVO\Desktop\mosaic-main\tiles.py:20: ShapelyDeprecationWarning: The 'type' attribute is deprecated, and will be removed in the future. You can use the 'geom_type' attribute instead.
if p.type not in ['MultiLineString','LineString', 'GeometryCollection']:
C:\Users\LENOVO\Desktop\mosaic-main\tiles.py:20: ShapelyDeprecationWarning: The 'type' attribute is deprecated, and will be removed in the future. You can use the 'geom_type' attribute instead.
if p.type not in ['MultiLineString','LineString', 'GeometryCollection']:
C:\Users\LENOVO\Desktop\mosaic-main\tiles.py:20: ShapelyDeprecationWarning: The 'type' attribute is deprecated, and will be removed in the future. You can use the 'geom_type' attribute instead.
if p.type not in ['MultiLineString','LineString', 'GeometryCollection']:
C:\Users\LENOVO\Desktop\mosaic-main\tiles.py:20: ShapelyDeprecationWarning: The 'type' attribute is deprecated, and will be removed in the future. You can use the 'geom_type' attribute instead.
if p.type not in ['MultiLineString','LineString', 'GeometryCollection']:
C:\Users\LENOVO\Desktop\mosaic-main\tiles.py:20: ShapelyDeprecationWarning: The 'type' attribute is deprecated, and will be removed in the future. You can use the 'geom_type' attribute instead.
if p.type not in ['MultiLineString','LineString', 'GeometryCollection']:
C:\Users\LENOVO\Desktop\mosaic-main\tiles.py:20: ShapelyDeprecationWarning: The 'type' attribute is deprecated, and will be removed in the future. You can use the 'geom_type' attribute instead.
if p.type not in ['MultiLineString','LineString', 'GeometryCollection']:
C:\Users\LENOVO\Desktop\mosaic-main\tiles.py:20: ShapelyDeprecationWarning: The 'type' attribute is deprecated, and will be removed in the future. You can use the 'geom_type' attribute instead.
if p.type not in ['MultiLineString','LineString', 'GeometryCollection']:
C:\Users\LENOVO\Desktop\mosaic-main\tiles.py:20: ShapelyDeprecationWarning: The 'type' attribute is deprecated, and will be removed in the future. You can use the 'geom_type' attribute instead.
if p.type not in ['MultiLineString','LineString', 'GeometryCollection']:
C:\Users\LENOVO\Desktop\mosaic-main\tiles.py:20: ShapelyDeprecationWarning: The 'type' attribute is deprecated, and will be removed in the future. You can use the 'geom_type' attribute instead.
if p.type not in ['MultiLineString','LineString', 'GeometryCollection']:
C:\Users\LENOVO\Desktop\mosaic-main\tiles.py:20: ShapelyDeprecationWarning: The 'type' attribute is deprecated, and will be removed in the future. You can use the 'geom_type' attribute instead.
if p.type not in ['MultiLineString','LineString', 'GeometryCollection']:
C:\Users\LENOVO\Desktop\mosaic-main\tiles.py:20: ShapelyDeprecationWarning: The 'type' attribute is deprecated, and will be removed in the future. You can use the 'geom_type' attribute instead.
if p.type not in ['MultiLineString','LineString', 'GeometryCollection']:
C:\Users\LENOVO\Desktop\mosaic-main\tiles.py:20: ShapelyDeprecationWarning: The 'type' attribute is deprecated, and will be removed in the future. You can use the 'geom_type' attribute instead.
if p.type not in ['MultiLineString','LineString', 'GeometryCollection']:
C:\Users\LENOVO\Desktop\mosaic-main\tiles.py:20: ShapelyDeprecationWarning: The 'type' attribute is deprecated, and will be removed in the future. You can use the 'geom_type' attribute instead.
if p.type not in ['MultiLineString','LineString', 'GeometryCollection']:
C:\Users\LENOVO\Desktop\mosaic-main\tiles.py:20: ShapelyDeprecationWarning: The 'type' attribute is deprecated, and will be removed in the future. You can use the 'geom_type' attribute instead.
if p.type not in ['MultiLineString','LineString', 'GeometryCollection']:
C:\Users\LENOVO\Desktop\mosaic-main\tiles.py:20: ShapelyDeprecationWarning: The 'type' attribute is deprecated, and will be removed in the future. You can use the 'geom_type' attribute instead.
if p.type not in ['MultiLineString','LineString', 'GeometryCollection']:
C:\Users\LENOVO\Desktop\mosaic-main\tiles.py:20: ShapelyDeprecationWarning: The 'type' attribute is deprecated, and will be removed in the future. You can use the 'geom_type' attribute instead.
if p.type not in ['MultiLineString','LineString', 'GeometryCollection']:
Traceback (most recent call last):
File "C:\Users\LENOVO\Desktop\mosaic-main\mosaic.py", line 73, in <module>
polygons_chains = tiles.place_tiles_along_chains(chains, angles_0to180, half_tile, RAND_SIZE, MAX_ANGLE, A0, plot=plot_list)
File "C:\Users\LENOVO\Desktop\mosaic-main\tiles.py", line 88, in place_tiles_along_chains
p = fit_in_polygon(p, nearby_polygons)
File "C:\Users\LENOVO\Desktop\mosaic-main\tiles.py", line 17, in fit_in_polygon
i_largest = np.argmax([p_i.area for p_i in p])
TypeError: 'MultiPolygon' object is not iterable
I did not change or modify anything. I am trying with default photo.
Python version: Python 3.10.7
Good evening,
I am attempting to run this script and am getting the following error. I have added the file path into line 15
fname = r'C:\Users\kirsl\Desktop\Pompei for MK\download.jpg' # let empty for test image
and the script returns this error:
PS C:\Users\kirsl\Downloads\mosaic-main\mosaic-main> python mosaic.py
Traceback (most recent call last):
File "C:\Users\kirsl\Downloads\mosaic-main\mosaic-main\mosaic.py", line 12, in
import edges, guides, tiles, convex, coloring, plotting
File "C:\Users\kirsl\Downloads\mosaic-main\mosaic-main\edges.py", line 4, in
import numpy as np
ModuleNotFoundError: No module named 'numpy'
I see the issue is with two modules, however I am at a loss for what to do to resolve these issues. Could somebody offer some guidance?
Hi, I'm stupid. Could somebody please give me a step by step?
Thank you so much.
hello, can you please describe where to put the input image and where the output is saved or where i can see it? Thanks
Hi. I need apply this to picture folder, but code pause in plot preview per image. I need disable preview for direct save result . Please help me .. This problem in line 1 here
` svg = plotting.draw_tiles(polygons_post, colors, h,w, background_brightness=0.2, return_svg=False, chains=None)
Hey there, excited to use your code but a bit of a novice. I've gotten the following error that I cant seem to troubleshoot:
Exception has occurred: TypeError
gaussian() got an unexpected keyword argument 'multichannel'
File "C:\Users\cludg\OneDrive\Desktop\python\mosaic-main\edges.py", line 108, in edges_hed
img = filters.gaussian(img, sigma=16, truncate=gauss/16, multichannel=True)
File "C:\Users\cludg\OneDrive\Desktop\python\mosaic-main\mosaic.py", line 60, in
img_edges = edges.edges_hed(img0, gauss=GAUSS, plot=plot_list)
TypeError: gaussian() got an unexpected keyword argument 'multichannel'
any feedback would be appreciated!
Hi Johannes! When I executed your code with my own figures, there will be an error popping out as shown below:
Size of input image: 645px * 899px
Estimated number of tiles: 2013
[ERROR:[email protected]] global /io/opencv/modules/dnn/src/dnn.cpp (3872) getLayerShapesRecursively OPENCV/DNN: [Convolution]:(conv1_1): getMemoryShapes() throws exception. inputs=1 outputs=0/1 blobs=2
[ERROR:[email protected]] global /io/opencv/modules/dnn/src/dnn.cpp (3878) getLayerShapesRecursively input[0] = [ 1 4 645 899 ]
[ERROR:[email protected]] global /io/opencv/modules/dnn/src/dnn.cpp (3886) getLayerShapesRecursively blobs[0] = CV_32FC1 [ 64 3 3 3 ]
[ERROR:[email protected]] global /io/opencv/modules/dnn/src/dnn.cpp (3886) getLayerShapesRecursively blobs[1] = CV_32FC1 [ 64 1 ]
[ERROR:[email protected]] global /io/opencv/modules/dnn/src/dnn.cpp (3888) getLayerShapesRecursively Exception message: OpenCV(4.5.5) /io/opencv/modules/dnn/src/layers/convolution_layer.cpp:404: error: (-2:Unspecified error) Number of input channels should be multiple of 3 but got 4 in function 'getMemoryShapes'
Traceback (most recent call last):
File "./mosaic.py", line 60, in
img_edges = edges.edges_hed(img0, gauss=GAUSS, plot=plot_list)
File "/mnt/d/Dropbox/code/web-project/Mosaic/mosaic-main/edges.py", line 113, in edges_hed
hed_matrix = hed_edges(img)
File "/mnt/d/Dropbox/code/web-project/Mosaic/mosaic-main/edges.py", line 99, in hed_edges
out = net.forward()
cv2.error: OpenCV(4.5.5) /io/opencv/modules/dnn/src/layers/convolution_layer.cpp:404: error: (-2:Unspecified error) Number of input channels should be multiple of 3 but got 4 in function 'getMemoryShapes'
I have searched on the internet, and still could not figure out how to solve it.
Hi,
I am getting:
File "/Users/john/Desktop/Mosaic/mosaic-main/edges.py", line 4, in
import numpy as np
ModuleNotFoundError: No module named 'numpy'
Can you help me here?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.