Giter Site home page Giter Site logo

rolabelimg's People

Contributors

cgvict avatar wkkmike avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rolabelimg's Issues

Zooming not into cursor's location plus missing hand feature

issue1

when it is need to zoom into an image, it seems zooming goes to a point in the left corner of image regardless of position of mouse cursor. Also hand feature is missing using which one can move the image. So one has to use sliding bars to move the image or using arrows which both are not the efficient ways to do so.

  • OS: Ubuntu 16.04

  • PyQt version: see below
    -- Python version: 2.7

from PyQt4.QtCore import QT_VERSION_STR
from PyQt4.pyqtconfig import Configuration
print("Qt version:", QT_VERSION_STR)
('Qt version:', '4.8.7')
cfg = Configuration()
 print("PyQt version:", cfg.pyqt_version_str)
('PyQt version:', '4.11.4')

AttributeError: 'NoneType' object has no attribute 'text'

issue1

  • **OS:**win11

  • Error: Traceback (most recent call last):
    File "roLabelImg.py", line 1142, in openNextImg
    self.loadFile(filename)
    File "roLabelImg.py", line 933, in loadFile
    self.loadPascalXMLByFilename(xmlPath)
    File "roLabelImg.py", line 1287, in loadPascalXMLByFilename
    tVocParseReader = PascalVocReader(xmlPath)
    File "E:\dt\roLabelImg-master\libs\pascal_voc_io.py", line 207, in init
    self.parseXML()
    File "E:\dt\roLabelImg-master\libs\pascal_voc_io.py", line 264, in parseXML
    if typeItem.text == 'bndbox':
    AttributeError: 'NoneType' object has no attribute 'text'

couldn't open annotation files

issue1

  • OS: ubuntu16.04

  • PyQt version: 4

  • Error: ./labelImg.py
    running with lxml.etree
    Traceback (most recent call last):
    File "./labelImg.py", line 1156, in openFile
    self.loadFile(filename)
    File "./labelImg.py", line 902, in loadFile
    self.lineColor = QColor(*self.labelFile.lineColor)
    AttributeError: 'LabelFile' object has no attribute 'lineColor'

when I run ./labelimg.py, a error as above occurs...
Also,after I finish labeling the image , I couldn't open annotation files.

ImportError: cannot import name 'struct' from 'lib' (unknown location)

I use pyinstaller https://github.com/cgvict/roLabelImg

environment:
windows10
anaconda3+python3.8
pyinstaller==4.5

compile process:

(base) C:\Users\Administrator\Desktop\roLabelImg-master>pyinstaller roLabelImg.spec
1619 INFO: PyInstaller: 4.5
1619 INFO: Python: 3.8.5 (conda)
1621 INFO: Platform: Windows-10-10.0.19041-SP0
1629 INFO: UPX is not available.
1631 INFO: Extending PYTHONPATH with paths
['C:\Users\Administrator\Desktop',
'E:\anaconda3\Lib\site-packages\PyQt5\Qt\bin',
'C:\Users\Administrator\Desktop\roLabelImg-master',
'E:\x07naconda3\Lib']
2719 INFO: checking Analysis
2719 INFO: Building Analysis because Analysis-00.toc is non existent
2720 INFO: Initializing module dependency graph...
2732 INFO: Caching module graph hooks...
2758 INFO: Analyzing base_library.zip ...
9456 INFO: Processing pre-find module path hook distutils from 'e:\anaconda3\lib\site-packages\PyInstaller\hooks\pre_find_module_path\hook-distutils.py'.
9457 INFO: distutils: retargeting to non-venv dir 'e:\anaconda3\lib'
14886 INFO: Caching module dependency graph...
15438 INFO: running Analysis Analysis-00.toc
15457 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
required by e:\anaconda3\python.exe
15766 INFO: Analyzing roLabelImg.py
16244 INFO: Processing module hooks...
16245 INFO: Loading module hook 'hook-difflib.py' from 'e:\anaconda3\lib\site-packages\PyInstaller\hooks'...
16249 INFO: Loading module hook 'hook-distutils.py' from 'e:\anaconda3\lib\site-packages\PyInstaller\hooks'...
16250 INFO: Loading module hook 'hook-distutils.util.py' from 'e:\anaconda3\lib\site-packages\PyInstaller\hooks'...
16253 INFO: Loading module hook 'hook-encodings.py' from 'e:\anaconda3\lib\site-packages\PyInstaller\hooks'...
16380 INFO: Loading module hook 'hook-heapq.py' from 'e:\anaconda3\lib\site-packages\PyInstaller\hooks'...
16383 INFO: Loading module hook 'hook-lib2to3.py' from 'e:\anaconda3\lib\site-packages\PyInstaller\hooks'...
16457 INFO: Loading module hook 'hook-multiprocessing.util.py' from 'e:\anaconda3\lib\site-packages\PyInstaller\hooks'...
16459 INFO: Loading module hook 'hook-pickle.py' from 'e:\anaconda3\lib\site-packages\PyInstaller\hooks'...
16461 INFO: Loading module hook 'hook-PyQt5.py' from 'e:\anaconda3\lib\site-packages\PyInstaller\hooks'...
17188 INFO: Loading module hook 'hook-PyQt5.QtCore.py' from 'e:\anaconda3\lib\site-packages\PyInstaller\hooks'...
17374 INFO: Loading module hook 'hook-PyQt5.QtGui.py' from 'e:\anaconda3\lib\site-packages\PyInstaller\hooks'...
17783 INFO: Loading module hook 'hook-PyQt5.QtWidgets.py' from 'e:\anaconda3\lib\site-packages\PyInstaller\hooks'...
18190 INFO: Loading module hook 'hook-sysconfig.py' from 'e:\anaconda3\lib\site-packages\PyInstaller\hooks'...
18191 INFO: Loading module hook 'hook-xml.etree.cElementTree.py' from 'e:\anaconda3\lib\site-packages\PyInstaller\hooks'...
18193 INFO: Loading module hook 'hook-xml.py' from 'e:\anaconda3\lib\site-packages\PyInstaller\hooks'...
18536 INFO: Loading module hook 'hook-_tkinter.py' from 'e:\anaconda3\lib\site-packages\PyInstaller\hooks'...
18743 INFO: checking Tree
18743 INFO: Building Tree because Tree-00.toc is non existent
18747 INFO: Building Tree Tree-00.toc
18914 INFO: checking Tree
18915 INFO: Building Tree because Tree-01.toc is non existent
18915 INFO: Building Tree Tree-01.toc
19053 INFO: checking Tree
19053 INFO: Building Tree because Tree-02.toc is non existent
19054 INFO: Building Tree Tree-02.toc
19078 INFO: Looking for ctypes DLLs
19130 INFO: Analyzing run-time hooks ...
19135 INFO: Including run-time hook 'e:\anaconda3\lib\site-packages\PyInstaller\hooks\rthooks\pyi_rth_pkgutil.py'
19140 INFO: Including run-time hook 'e:\anaconda3\lib\site-packages\PyInstaller\hooks\rthooks\pyi_rth_multiprocessing.py'
19145 INFO: Including run-time hook 'e:\anaconda3\lib\site-packages\PyInstaller\hooks\rthooks\pyi_rth_win32api.py'
19165 INFO: Including run-time hook 'e:\anaconda3\lib\site-packages\PyInstaller\hooks\rthooks\pyi_rth_inspect.py'
19169 INFO: Including run-time hook 'e:\anaconda3\lib\site-packages\PyInstaller\hooks\rthooks\pyi_rth_pyqt5.py'
19178 INFO: Looking for dynamic libraries
20427 INFO: Looking for eggs
20428 INFO: Using Python library e:\anaconda3\python38.dll
20429 INFO: Found binding redirects:
[]
20437 INFO: Warnings written to C:\Users\Administrator\Desktop\roLabelImg-master\build\roLabelImg\warn-roLabelImg.txt
20507 INFO: Graph cross-reference written to C:\Users\Administrator\Desktop\roLabelImg-master\build\roLabelImg\xref-roLabelImg.html
20521 INFO: checking PYZ
20521 INFO: Building PYZ because PYZ-00.toc is non existent
20521 INFO: Building PYZ (ZlibArchive) C:\Users\Administrator\Desktop\roLabelImg-master\build\roLabelImg\PYZ-00.pyz
21434 INFO: Building PYZ (ZlibArchive) C:\Users\Administrator\Desktop\roLabelImg-master\build\roLabelImg\PYZ-00.pyz completed successfully.
21447 INFO: checking PKG
21447 INFO: Building PKG because PKG-00.toc is non existent
21447 INFO: Building PKG (CArchive) PKG-00.pkg
21499 INFO: Building PKG (CArchive) PKG-00.pkg completed successfully.
21501 INFO: Bootloader e:\anaconda3\lib\site-packages\PyInstaller\bootloader\Windows-64bit\runw.exe
21501 INFO: checking EXE
21504 INFO: Building EXE because EXE-00.toc is non existent
21504 INFO: Building EXE from EXE-00.toc
21507 INFO: Copying icons from ['e:\anaconda3\lib\site-packages\PyInstaller\bootloader\images\icon-windowed.ico']
21509 INFO: Writing RT_GROUP_ICON 0 resource with 104 bytes
21510 INFO: Writing RT_ICON 1 resource with 3752 bytes
21510 INFO: Writing RT_ICON 2 resource with 2216 bytes
21511 INFO: Writing RT_ICON 3 resource with 1384 bytes
21512 INFO: Writing RT_ICON 4 resource with 38188 bytes
21512 INFO: Writing RT_ICON 5 resource with 9640 bytes
21513 INFO: Writing RT_ICON 6 resource with 4264 bytes
21513 INFO: Writing RT_ICON 7 resource with 1128 bytes
21644 INFO: Appending archive to EXE C:\Users\Administrator\Desktop\roLabelImg-master\build\roLabelImg\roLabelImg.exe
23046 INFO: Building EXE from EXE-00.toc completed successfully.
23049 INFO: checking COLLECT
23049 INFO: Building COLLECT because COLLECT-00.toc is non existent
23051 INFO: Building COLLECT COLLECT-00.toc
25851 INFO: Building COLLECT COLLECT-00.toc completed successfully.

when I run exe.error occured

Traceback (most recent call last):
File "roLabelImg.py", line 32, in
ImportError: cannot import name 'struct' from 'lib' (unknown location)

No Rotated BBoxes

Rotation Bounsing box does not work.

I am trying to annotate a ship using the rotated BBox feature, but it is exactly the same as BBox feature without rotation. I am using PyQt4 and not 5.
screenshot from 2017-08-29 11-11-51

  • OS: Ubuntu16.04

  • PyQt version: below

from PyQt4.QtCore import QT_VERSION_STR
from PyQt4.pyqtconfig import Configuration
print("Qt version:", QT_VERSION_STR)
('Qt version:', '4.8.7')
cfg = Configuration()
 print("PyQt version:", cfg.pyqt_version_str)
('PyQt version:', '4.11.4')

Rotated rectangle implementation [Question]

I'm trying to get some parameters from a rotated rectangle in the roLabelImg generated XML and print the rectangle with matplotlib, which has a very similar representation, with variables "center coordinates, widht/height and angle":
Matplotlib: Rectangle((cx, cy), width=w, height=h, angle=theta).

So long I haven't been able to do that. I've even tried to do transformations like: cx' = cx - l*math.cos(theta+alfa)
I've considered the center points maybe could be different, because in matplotlib they represent xmin, ymin, so it can explain the transformation above. But didn't work.
So I'd like to know what is your implementation, or if you know how can i transform your coordinates to matplotlib style. Well, i would appreciate some help. Thanks!

RotateBox and Python3

The executable pre built by the author does not support RotateBox. If you want to use RotateBox, you must build it from the source code. If you use Python3, please change "pyrcc4 -o resources.py resources.qrc" to "pyrcc4 -o resources.py -py3 resources.qrc"

由作者预构建的可执行文件不支持rotateBox,如果你想使用rotateBox,你必须从源码构建,如果你使用的是python3,请把“pyrcc4 -o resources.py resources.qrc”改成“pyrcc4 -o resources.py -py3 resources.qrc”.

on zoomin image horizontal and vertical scroll bars are not visible in mac

On zoom in image horizontal and vertical scroll bars are not visible

  • OS: mac os

  • PyQt version: 5

  • Error: Segmentation fault: 11

  • Solution: open labelImg.py, go to line 175, comment this line.

        self.filedock.setWidget(fileListContainer)

        self.zoomWidget = ZoomWidget()
        # self.colorDialog = ColorDialog(parent=self)

        self.canvas = Canvas()

Image pan and zoom in and out from center are not working 【New 2021】

FROM: #13 (comment)

I also encountered the same problem

I tried to solve him in a bad way

filepath:  roLabelImg-master\libs\canvas.py    line: 159

if Qt.LeftButton & ev.buttons():
            self.MouseMove = ev.pos() - self.preMousePosition
            self.preMousePosition = ev.pos() 
            self.prevPoint = self.pos() + self.MouseMove
            self.move(self.prevPoint)
                
filepath:  roLabelImg-master\libs\canvas.py    line: 225

self.preMousePosition = ev.pos()

If you have any good plan, please contact me, thank you very much

Image pan and zoom in and out from center are not working

could you integrate code for image pan and also image zoom in and out from center, currently its zooming form top left corner. I would be great If you could integrate the code and update ASAP

  • OS: mac os

  • PyQt version: 5

  • Error: Segmentation fault: 11

  • Solution: open labelImg.py, go to line 175, comment this line.

        self.filedock.setWidget(fileListContainer)

        self.zoomWidget = ZoomWidget()
        # self.colorDialog = ColorDialog(parent=self)

        self.canvas = Canvas()

not woriking on Windows

I've managed to get it open only with Python 2.7 and PyQt 4.11. in Anaconda. With all other image types (except for png), I can't open the image and get an error:
libpng warning: iCCP: known incorrect sRGB profile

Also, I'm unable to select none of the predefined classes.

  • OS: Windows 7

  • PyQt version: 4

  • Error: libpng warning: iCCP: known incorrect sRGB profile

Any help is appreciated.

Select multiple objects at the same time to move or rotate

I noticed the tool can only select one rotated labeling box at the same time. Is it possible to select multiple objects at the same time to move or rotate? Also, how can I keep the previous annotation when create the annotation of the next image in the directory? Thank you.

Augmentation tool for Oriented annotations

Hi,

Thanks for your great work on this tool. I am wondering if there is any augmentation tool that augments images with rotated bounding boxes ?

There is one tool https://github.com/mukopikmin/bounding-box-augmentation which augments images with bounding boxes, But it doesnt have support for rotated bounding box.

If you know of any tool that works with your annotations and augments images with bounding boxes, please let me know. Thanks.

PyQt4”: ValueError: PyCapsule_GetPointer called with incorrect names()

issue1

  • OS: Windows

  • PyQt version: 4

(ro) C:\Users\dians\Desktop\deep\roLabelImg-master>python rolabelimg.py
Traceback (most recent call last):
  File "rolabelimg.py", line 27, in <module>
    import resources
  File "C:\Users\dians\Desktop\deep\roLabelImg-master\resources.py", line 9, in <module>
    from PyQt4 import QtCore
ValueError: PyCapsule_GetPointer called with incorrect names()

large rotation steps do not add up to 360 deg.

It currently is not possible to return to horizontal or vertical using the large Z and V, or even the small X and C steps. This is caused by the large steps being 0.1 radians and the small steps 0.1 radians, which will never add up to 2*Pi.

proposed to use math.radians() in roLabelImg-master/libs/canvas.py as below:

            self.selectedShape.isRotated and not self.rotateOutOfBound(math.radians(45)):
            self.selectedShape.rotate(math.radians(45))
            self.shapeMoved.emit() 
            self.update()  
        elif key == Qt.Key_X and self.selectedShape and\
             self.selectedShape.isRotated and not self.rotateOutOfBound(math.radians(2.5)):
            self.selectedShape.rotate(math.radians(2.5)) 
            self.shapeMoved.emit()
            self.update()  
        elif key == Qt.Key_C and self.selectedShape and\
             self.selectedShape.isRotated and not self.rotateOutOfBound(-math.radians(2.5)):
            self.selectedShape.rotate(-math.radians(2.5)) 
            self.shapeMoved.emit()
            self.update()  
        elif key == Qt.Key_V and self.selectedShape and\
             self.selectedShape.isRotated and not self.rotateOutOfBound(-math.radians(45)):
            self.selectedShape.rotate(-math.radians(45))
            self.shapeMoved.emit()
            self.update()

This does 45deg large steps and 2.5 deg small steps, but anything reasonable will do.
It's also much easier to understand for someone to change the values.

Loading the image will auto rotated

When I used roLabelImg to label the OCR pictures, I found it will automatically rotate the original image. Meanwhile, it is difficult to label the originally rotated photos. Could you please add a rotating selection(0°, 180°, 270°,90°) and save the rotated images & their boxes information?

Save output as YOLO txt format

Hi, can someone help point me to which part of the code do I modify in order to save output as yolo format in txt file please

<label/class ID>
e.g 0 0.643333 0.166667 0.252222 0.318519

The angle's defination

Hi,
It's a very nice work!
But I wonder the rectangle's angle's definition.
It seems that in your program, the angle depends on rotating clockwise/anticlockwise how many times.
But I feel in most of the time, the rectangle's angle is defined as the angle between the longer side and a coordinate axis.
If the angle is defined by rotating clockwise/anticlockwise how many times, there will be some problem, I thought.

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.