Code Monkey home page Code Monkey logo

mask2json's Issues

json2mask.py module 'labelme.utils' has no attribute 'draw_label'

@guchengxi1994

when runing json2mask.py using my sample data.zip

(d2) home@home-desktop:~/0/vision_data_tools-master/data$ python json2mask.py 
[WARNING] shape:labelme_shapes_to_label:80 - labelme_shapes_to_label is deprecated, so please use shapes_to_label.
Traceback (most recent call last):
  File "json2mask.py", line 95, in <module>
    singleFile('./5.json')
  File "json2mask.py", line 67, in singleFile
    lbl_viz = utils.draw_label(lbl, img, captions)
AttributeError: module 'labelme.utils' has no attribute 'draw_label'

AttributeError: module 'matplotlib.cbook' has no attribute '_rename_parameter'

All requirements were successfully installed but when yolo2xml converter is imported it throws the following error related to skimage package.

from convertmask.utils.yolo2xml.yolo2xml import y2xConvert
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Input In [10], in <cell line: 1>()
----> 1 from convertmask.utils.yolo2xml.yolo2xml import y2xConvert

File E:\PXR\DATASETS\NAEMURALAB2015\BIRD_v200_1_1\convertmask\utils\yolo2xml\yolo2xml.py:17, in <module>
     15 from convertmask.utils.methods.logger import logger
     16 from convertmask.utils.xml2yolo.xml2yolo import readLabels
---> 17 from skimage import io
     18 from tqdm import tqdm
     21 def y2xConvert(txtPath, imgPath, labelPath):

File ~\.conda\envs\pxr\lib\site-packages\skimage\io\__init__.py:15, in <module>
     11 from ._io import *
     12 from ._image_stack import *
---> 15 reset_plugins()
     17 WRAP_LEN = 73
     20 def _separator(char, lengths):

File ~\.conda\envs\pxr\lib\site-packages\skimage\io\manage_plugins.py:87, in reset_plugins()
     85 def reset_plugins():
     86     _clear_plugins()
---> 87     _load_preferred_plugins()

File ~\.conda\envs\pxr\lib\site-packages\skimage\io\manage_plugins.py:67, in _load_preferred_plugins()
     64 io_types = ['imsave', 'imshow', 'imread_collection', 'imshow_collection',
     65             'imread']
     66 for p_type in io_types:
---> 67     _set_plugin(p_type, preferred_plugins['all'])
     69 plugin_types = (p for p in preferred_plugins.keys() if p != 'all')
     70 for p_type in plugin_types:

File ~\.conda\envs\pxr\lib\site-packages\skimage\io\manage_plugins.py:79, in _set_plugin(plugin_type, plugin_list)
     77     continue
     78 try:
---> 79     use_plugin(plugin, kind=plugin_type)
     80     break
     81 except (ImportError, RuntimeError, OSError):

File ~\.conda\envs\pxr\lib\site-packages\skimage\io\manage_plugins.py:250, in use_plugin(name, kind)
    247     else:
    248         kind = [kind]
--> 250 _load(name)
    252 for k in kind:
    253     if k not in plugin_store:

File ~\.conda\envs\pxr\lib\site-packages\skimage\io\manage_plugins.py:293, in _load(plugin)
    291 else:
    292     modname = plugin_module_name[plugin]
--> 293     plugin_module = __import__('skimage.io._plugins.' + modname,
    294                                fromlist=[modname])
    296 provides = plugin_provides[plugin]
    297 for p in provides:

File ~\.conda\envs\pxr\lib\site-packages\skimage\io\_plugins\matplotlib_plugin.py:3, in <module>
      1 from collections import namedtuple
      2 import numpy as np
----> 3 from mpl_toolkits.axes_grid1 import make_axes_locatable
      4 import matplotlib.image
      5 from ...util import dtype as dtypes

File ~\.conda\envs\pxr\lib\site-packages\mpl_toolkits\axes_grid1\__init__.py:3, in <module>
      1 from . import axes_size as Size
      2 from .axes_divider import Divider, SubplotDivider, make_axes_locatable
----> 3 from .axes_grid import Grid, ImageGrid, AxesGrid
      5 from .parasite_axes import host_subplot, host_axes

File ~\.conda\envs\pxr\lib\site-packages\mpl_toolkits\axes_grid1\axes_grid.py:32, in <module>
     28     ax.axis["bottom"].toggle(ticklabels=bottom_off, label=bottom_off)
     29     ax.axis["left"].toggle(ticklabels=left_off, label=left_off)
---> 32 class CbarAxesBase:
     34     @cbook._rename_parameter("3.2", "locator", "ticks")
     35     def colorbar(self, mappable, *, ticks=None, **kwargs):
     37         if self.orientation in ["top", "bottom"]:

File ~\.conda\envs\pxr\lib\site-packages\mpl_toolkits\axes_grid1\axes_grid.py:34, in CbarAxesBase()
     32 class CbarAxesBase:
---> 34     @cbook._rename_parameter("3.2", "locator", "ticks")
     35     def colorbar(self, mappable, *, ticks=None, **kwargs):
     37         if self.orientation in ["top", "bottom"]:
     38             orientation = "horizontal"

AttributeError: module 'matplotlib.cbook' has no attribute '_rename_parameter'

test_imgAug Labels class0

Thank you for your source code
very nice
It's very helpful

But I have a problem

Labels class0
And the original labels name
atypism

class0
class0(null)

test_imgAug.py
Labels class0

ERROR mask2json

python mask2json.py
Traceback (most recent call last):
File "mask2json.py", line 15, in
getMultiShapes.getMultiShapes(imgPath, maskPath, savePath) # without yaml
File "C:\Users\Siwal\AppData\Local\Programs\Python\Python37\lib\site-packages\convertmask\utils\getMultiShapes.py", line 229, in getMultiShapes
raise FileNotFoundError('mask/labeled image not found')
FileNotFoundError: mask/labeled image not found

Python version

I always get an error when I use pip install -r requests.txt, what is the version of Python you are using?

test_imgAug How to cycle catalog pictures

test_imgAug.py

How to cycle catalog pictures

Now it can only be read one by one

How to batch read folder directory pictures

I found the name fixed
mask2json\convertmask\utils\auglib\imgAug.py
Simple modification
fileName = str(''.join(random.sample(string.ascii_letters + string.digits, 8)))

It should be more reasonable

json2mask has no output

@guchengxi1994
when running json2mask i get no output mask.
note the i modified: D:\\testALg\\mask2json\\mask2json\\static\\ to ./static
there is no mask created

are you available

@guchengxi1994 hi,
i have a task dealing with masks,
are you available for freelancing?
what is your email so i can discuss in more detail

Mask2json cannot recognize multiple labels

Why does the output json file have only one label? Does this code only recognize the single label of the mask?
Here's my data:
mask pic:
2056

label_names:
image

the output json:
image

I look forward to receiving guidance, thank you !

test_imgAug affedMask = cv2.warpAffine(mask, mat, (imgShape[1], imgShape[0]))

python test_imgAug.py
ERROR argument should be a bytes-like object or ASCII string, not 'NoneType' (convert.py:102)
imgEncode is deprecated under 0.5.3.
WARNING rotation may cause salt-and-pepper noise. in order to solve this issue, small objects may be missing! (imgAug.py:464)
ERROR argument should be a bytes-like object or ASCII string, not 'NoneType' (convert.py:102)
Traceback (most recent call last):
  File "test_imgAug.py", line 37, in <module>
    imgRotation(imgPath, labelPath)
  File "..\convertmask\utils\auglib\imgAug.py", line 495, in imgRotation
    affedMask = cv2.warpAffine(mask, mat, (imgShape[1], imgShape[0]))
cv2.error: OpenCV(4.6.0) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\imgwarp.cpp:2595: error: (-215:Assertion failed) src.cols > 0 && src.rows > 0 in function 'cv::warpAffine'

labelme\examples\instance_segmentation\data_annotated\2011_000003.jpg
labelme\examples\instance_segmentation\data_annotated\2011_000003.json

2011_000003

mask 2 json

Hi, thanks for the code.
I have a mask (binary file) and original image.
How can I change it to JSON file ? I tried run the script in ur guide. But it's failed to get the information of area value 1 in mask file.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.