Comments (12)
@sszzy0317 here is it https://www.codepile.net/pile/N8akd162
from synthtext.
You can use any image segmentation algorithm. Skimage has several:
http://scikit-image.org/docs/dev/api/skimage.segmentation.html
from synthtext.
thanks, i got the segmentation. Then, in which format do you store the segmented image in the .mat file
I tried as a numpy array and i got this error when i try to execute the foodfill.py script
`
Traceback (most recent call last):
File "floodFill.py", line 132, in
process_db_parallel(base_dir)
File "floodFill.py", line 115, in process_db_parallel
for res in ucm_result:
File "/home/deep/miniconda3/envs/env_dataset/lib/python2.7/multiprocessing/pool.py", line 668, in next
raise value
AttributeError: 'numpy.int64' object has no attribute 'encode'
`
from synthtext.
Please check the format details in dset.h5
from synthtext.
yes, i got the segmentation and depth and added them to the dataset
i got an error :
File "/media/sf_PartageVM/Dataset/SynthText/synthgen.py", line 619, in render_text
regions = self.filter_for_placement(xyz,seg,regions)
File "/media/sf_PartageVM/Dataset/SynthText/synthgen.py", line 395, in filter_for_placement
res = get_text_placement_mask(xyz,seg==l,regions['coeff'][idx],pad=2)
File "/media/sf_PartageVM/Dataset/SynthText/synthgen.py", line 252, in get_text_placement_mask
s = rescale_frontoparallel(pts_tmp,boxR,pts[0])
File "/media/sf_PartageVM/Dataset/SynthText/synthgen.py", line 200, in rescale_frontoparallel
lt1 = np.linalg.norm(p_im[n1,:]-p_im[n0,:])
IndexError: too many indices for array
Apparently it is not detecting contours !
Here is the dataset with one new image https://ufile.io/u2fs3
if you have any idea tell me...
thank you.
from synthtext.
@kaislar Did you get ucm.mat by using python? I got the data of segmentation, but there may someting wrong with the format. I ran with the error below:
File "/Users/edgar/project/pyCodes/SynthText/synthgen.py", line 626, in render_text
regions = self.filter_for_placement(xyz,seg,regions)
File "/Users/edgar/project/pyCodes/SynthText/synthgen.py", line 395, in filter_for_placement
res = get_text_placement_mask(xyz,seg==l,regions['coeff'][idx],pad=2)
File "/Users/edgar/project/pyCodes/SynthText/synthgen.py", line 243, in get_text_placement_mask
R2d = su.unrotate2d(box.copy())
File "/Users/edgar/project/pyCodes/SynthText/synth_utils.py", line 262, in unrotate2d
l,R = np.linalg.eig(pts.T.dot(pts))
File "/Users/edgar/.pyenv/versions/anaconda2-4.0.0/lib/python2.7/site-packages/numpy/linalg/linalg.py", line 1122, in eig
_assertFinite(a)
File "/Users/edgar/.pyenv/versions/anaconda2-4.0.0/lib/python2.7/site-packages/numpy/linalg/linalg.py", line 217, in _assertFinite
raise LinAlgError("Array must not contain infs or NaNs")
LinAlgError: Array must not contain infs or NaNs
If you had solve the problem, can you share me the idea?
from synthtext.
i wrote a python script using slic from skimage.segmentation to perform segmentation and then i count the area of each segmented region.
So i didn't use the .mat file i created my own dataset with new images
from synthtext.
@kaislar
thanks for your reply .
I tried the skimage.segmentation method, but got the some error. Maybe there is something wrong with other data. I generated the depth image using the tensorflow branch of FCRN.
from synthtext.
For segmented image did you get the labels and areas attributes stored the database. Look to the sample database to understand how to store them
from synthtext.
@kaislar
would you share your python file for segmentation, I have trouble with using the OpenCV
from synthtext.
@kaislar THANKS, I Have built the model like
"segment = slic(img, n_segments=100, compactness=20)"
but I didn't known the meaning of the parameter of n_segments and compactness
from synthtext.
@kaislaribi Thanks for sharing your code snippet. It was helpful.
@ankush-me I managed to run create a dset.h5 file using custom images with homes. It returns synthetic text as expected for some images (like shown below). However for some images it is throwing error similar to what is mentioned by @kaislaribi
Stack Trace of Errors (for some of the images) -
Traceback (most recent call last):
File "/media/mayub/OS/Users/Admin/Documents/GitHub/SynthText/synthgen.py", line 615, in render_text
regions = self.filter_for_placement(xyz,seg,regions)
File "/media/mayub/OS/Users/Admin/Documents/GitHub/SynthText/synthgen.py", line 391, in filter_for_placement
res = get_text_placement_mask(xyz,seg==l,regions['coeff'][idx],pad=2)
File "/media/mayub/OS/Users/Admin/Documents/GitHub/SynthText/synthgen.py", line 250, in get_text_placement_mask
s = rescale_frontoparallel(pts_tmp,boxR,pts[0])
File "/media/mayub/OS/Users/Admin/Documents/GitHub/SynthText/synthgen.py", line 200, in rescale_frontoparallel
lt1 = np.linalg.norm(p_im[n1,:]-p_im[n0,:])
IndexError: too many indices for array: array is 1-dimensional, but 2 were indexed
I'm guessing this is because it did not find any good segments ? I might be wrong.
Here is one image it threw error on.
For reference, this is how the masks and segments look like for the error image:
Any specific settings I can change to accommodate these images.
Thanks in advance !
from synthtext.
Related Issues (20)
- Changing text render areas HOT 1
- Generator gives bad result HOT 4
- Ground truth file HOT 3
- results/SynthText.h5
- Text database
- Generating just one word HOT 1
- Saving masks in folder HOT 1
- Pizda shaatsan how to get generated picture with text but without border ? HOT 1
- AssertionError and text placement parameters misunderstanding
- Incorrect visualization of bboxes HOT 5
- Negative value of word-level bounding-boxes in gt.mat
- Mask and bounding boxes HOT 4
- Downloading of SynthText Pre-generated Dataset HOT 8
- Undefined functions in predict_depth.m in prep_scripts HOT 3
- Anyone know how to disable mirrored/backwards text? HOT 1
- zero-size array
- Some special characters are not generated HOT 3
- Can you generate a composite image consisting entirely of '+', '-', numbers, and decimal points?
- Do you have a non torrent download address? I would like to obtain the depth and seg of SynthText, as well as the original image file HOT 1
- Incorrect BBoxes
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from synthtext.