Git Product home page Git Product logo

Comments (6)

tzutalin avatar tzutalin commented on July 30, 2024

Hi @lzx1413 ,
Currently, I used opencv to get the shape of the image when creating pascal file. Do you have an alternative way to get shape of an image?
libs/labelFile.py:

        img = cv2.imread(imagePath)
        imageShape = img.shape

from labelimg.

lzx1413 avatar lzx1413 commented on July 30, 2024

in labelImg.py

image = QImage.fromData(self.imageData)
self.image_shape.append(image.width())
self.image_shape.append(image.height())
self.image_shape.append(3)//this is not good enough but I don not find a good function to meet it

then the parameters can be send to the save function

from labelimg.

ck196 avatar ck196 commented on July 30, 2024

If you only need shape of image, you could you PIL.

from PIL import Image

with Image.open(filename) as im:
    width, height = im.size

It is easy to install, openCV is very heavy and hard to install. It comes up for non-IT person use your tools.

from labelimg.

tzutalin avatar tzutalin commented on July 30, 2024

Hi ,
Sorry. I am busy with other stuffs this month. I will remove Opencv next month. If possible, you can send a PR and test it, I will review and merge it.

from labelimg.

lzx1413 avatar lzx1413 commented on July 30, 2024

Hi,
@ck196 yep,I just want to make the size of the software after packaged less :)
@tzutalin I have make a lot of change on this project,so it may be not easy to create a pr to merge it to this branch.It's just a suggestion to rm the opencv

from labelimg.

tzutalin avatar tzutalin commented on July 30, 2024

Fix it
4a3a47a

from labelimg.

Related Issues (20)

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.