• 大小: 6.40M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2024-05-09
  • 语言: Python
  • 标签: label  ZIP  LAB  AB  IM  

资源简介

图片标注工具

资源截图

代码片段和文件信息

#!/usr/bin/env python
# -*- coding: utf-8 -*-
import codecs
import distutils.spawn
import os.path
import platform
import re
import sys
import subprocess

from functools import partial
from collections import defaultdict

try:
    from PyQt5.QtGui import *
    from PyQt5.QtCore import *
    from PyQt5.QtWidgets import *
except ImportError:
    # needed for py3+qt4
    # Ref:
    # http://pyqt.sourceforge.net/Docs/PyQt4/incompatible_apis.html
    # http://stackoverflow.com/questions/21217399/pyqt4-qtcore-qvariant-object-instead-of-a-string
    if sys.version_info.major >= 3:
        import sip
        sip.setapi(‘QVariant‘ 2)
    from PyQt4.QtGui import *
    from PyQt4.QtCore import *

import resources
# Add internal libs
from libs.constants import *
from libs.lib import struct newAction newIcon addActions fmtShortcut generateColorByText
from libs.settings import Settings
from libs.shape import Shape DEFAULT_LINE_COLOR DEFAULT_FILL_COLOR
from libs.stringBundle import StringBundle
from libs.canvas import Canvas
from libs.zoomWidget import ZoomWidget
from libs.labelDialog import LabelDialog
from libs.colorDialog import ColorDialog
from libs.labelFile import LabelFile LabelFileError
from libs.toolBar import ToolBar
from libs.pascal_voc_io import PascalVocReader
from libs.pascal_voc_io import xml_EXT
from libs.yolo_io import YoloReader
from libs.yolo_io import TXT_EXT
from libs.ustr import ustr
from libs.version import __version__
from libs.hashableQListWidgetItem import HashableQListWidgetItem

__appname__ = ‘labelImg‘

# Utility functions and classes.

def have_qstring():
    ‘‘‘p3/qt5 get rid of QString wrapper as py3 has native unicode str type‘‘‘
    return not (sys.version_info.major >= 3 or QT_VERSION_STR.startswith(‘5.‘))

def util_qt_strlistclass():
    return QStringList if have_qstring() else list


class WindowMixin(object):

    def menu(self title actions=None):
        menu = self.menuBar().addMenu(title)
        if actions:
            addActions(menu actions)
        return menu

    def toolbar(self title actions=None):
        toolbar = ToolBar(title)
        toolbar.setobjectName(u‘%sToolBar‘ % title)
        # toolbar.setOrientation(Qt.Vertical)
        toolbar.setToolButtonstyle(Qt.ToolButtonTextUnderIcon)
        if actions:
            addActions(toolbar actions)
        self.addToolBar(Qt.LeftToolBarArea toolbar)
        return toolbar


class MainWindow(QMainWindow WindowMixin):
    FIT_WINDOW FIT_WIDTH MANUAL_ZOOM = list(range(3))

    def __init__(self defaultFilename=None defaultPrefdefClassFile=None defaultSaveDir=None):
        super(MainWindow self).__init__()
        self.setWindowtitle(__appname__)

        # Load setting in the main thread
        self.settings = Settings()
        self.settings.load()
        settings = self.settings

        # Load string bundle for i18n
        self.stringBundle = StringBundle.getBundle()
        getStr = lambda strId: self.stringBundle.getString(strId)

   

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-12-03 05:21  labelImg-1.8.1\
     文件         152  2018-12-03 05:21  labelImg-1.8.1\.gitignore
     文件        2461  2018-12-03 05:21  labelImg-1.8.1\.travis.yml
     文件          83  2018-12-03 05:21  labelImg-1.8.1\CONTRIBUTING.rst
     文件        1339  2018-12-03 05:21  labelImg-1.8.1\HISTORY.rst
     文件        1197  2018-12-03 05:21  labelImg-1.8.1\LICENSE
     文件         300  2018-12-03 05:21  labelImg-1.8.1\MANIFEST.in
     文件         381  2018-12-03 05:21  labelImg-1.8.1\Makefile
     文件        8345  2018-12-03 05:21  labelImg-1.8.1\README.rst
     文件           0  2018-12-03 05:21  labelImg-1.8.1\__init__.py
     目录           0  2018-12-03 05:21  labelImg-1.8.1\build-tools\
     文件         108  2018-12-03 05:21  labelImg-1.8.1\build-tools\.gitignore
     文件         454  2018-12-03 05:21  labelImg-1.8.1\build-tools\README.md
     文件         725  2018-12-03 05:21  labelImg-1.8.1\build-tools\build-for-macos.sh
     文件         680  2018-12-03 05:21  labelImg-1.8.1\build-tools\build-for-pypi.sh
     文件         656  2018-12-03 05:21  labelImg-1.8.1\build-tools\build-ubuntu-binary.sh
     文件         882  2018-12-03 05:21  labelImg-1.8.1\build-tools\build-windows-binary.sh
     文件        1566  2018-12-03 05:21  labelImg-1.8.1\build-tools\envsetup.sh
     文件         383  2018-12-03 05:21  labelImg-1.8.1\build-tools\run-in-container.sh
     目录           0  2018-12-03 05:21  labelImg-1.8.1\data\
     文件         145  2018-12-03 05:21  labelImg-1.8.1\data\predefined_classes.txt
     目录           0  2018-12-03 05:21  labelImg-1.8.1\demo\
     文件       58243  2018-12-03 05:21  labelImg-1.8.1\demo\demo.jpg
     文件       91238  2018-12-03 05:21  labelImg-1.8.1\demo\demo3.jpg
     文件     2843527  2018-12-03 05:21  labelImg-1.8.1\demo\demo4.png
     文件     3240759  2018-12-03 05:21  labelImg-1.8.1\demo\demo5.png
     文件         145  2018-12-03 05:21  labelImg-1.8.1\issue_template.md
     文件       59021  2018-12-03 05:21  labelImg-1.8.1\labelImg.py
     目录           0  2018-12-03 05:21  labelImg-1.8.1\libs\
     文件           0  2018-12-03 05:21  labelImg-1.8.1\libs\__init__.py
     文件       25982  2018-12-03 05:21  labelImg-1.8.1\libs\canvas.py
............此处省略77个文件信息

评论

共有 条评论