• 大小: 977KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-05-22
  • 语言: 其他
  • 标签: labelimg  图片标注  

资源简介

LabelImg可运行的历史版本,非最新版,参考https://github.com/tzutalin/labelImg。使用方法:解压后,执行./labelimg.py命令

资源截图

代码片段和文件信息

#!/usr/bin/env python
# -*- coding: utf8 -*-
import _init_path
import os.path
import re
import sys
import subprocess

from functools import partial
from collections import defaultdict

from PyQt4.QtGui import *
from PyQt4.QtCore import *

import resources

from lib import struct newAction newIcon addActions fmtShortcut
from shape import Shape DEFAULT_LINE_COLOR DEFAULT_FILL_COLOR
from canvas import Canvas
from zoomWidget import ZoomWidget
from labelDialog import LabelDialog
from colorDialog import ColorDialog
from labelFile import LabelFile LabelFileError
from toolBar import ToolBar
from pascal_voc_io import PascalVocReader

__appname__ = ‘labelImg‘

### Utility functions and classes.

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 = range(3)

    def __init__(self filename=None):
        super(MainWindow self).__init__()
        self.setWindowtitle(__appname__)
        # Save as Pascal voc xml
        self.defaultSaveDir = None
        self.usingPascalVocFormat = True
        if self.usingPascalVocFormat:
            LabelFile.suffix = ‘.xml‘
        # For loading all image under a directory
        self.mImgList = []
        self.dirname = None
        self.labelHist = []
        self.lastOpenDir = None

        # Whether we need to save or not.
        self.dirty = False

        # Enble auto saving if pressing next
        self.autoSaving = True
        self._noSelectionSlot = False
        self._beginner = True
        self.screencastViewer = “firefox“
        self.screencast = “https://youtu.be/p0nR2YsCY_U“

        self.loadPredefinedClasses()
        # Main widgets and related state.
        self.labelDialog = LabelDialog(parent=self listItem=self.labelHist)
        self.labelList = QListWidget()
        self.itemsToShapes = {}
        self.shapesToItems = {}

        self.labelList.itemActivated.connect(self.labelSelectionchanged)
        self.labelList.itemSelectionchanged.connect(self.labelSelectionchanged)
        self.labelList.itemDoubleClicked.connect(self.editLabel)
        # Connect to itemChanged to detect checkbox changes.
        self.labelList.itemChanged.connect(self.labelItemChanged)

        listLayout = QVBoxLayout()
        listLayout.setContentsMargins(0 0 0 0)
        listLayout.addWidget(self.labelList)
        self.editButton = QToolButton()
        self.editButton.setToolButtonstyle(Qt.ToolButtonTextBesideIcon)

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2017-02-20 07:04  labelImg-master\
     文件         451  2016-12-12 13:50  labelImg-master\_init_path.pyc
     文件         131  2016-12-09 16:24  labelImg-master\_init_path.py
     文件        1208  2016-12-09 16:24  labelImg-master\resources.qrc
     文件      413140  2017-02-20 07:04  labelImg-master\resources.py
     文件        2840  2016-12-09 16:24  labelImg-master\README.md
     文件          50  2016-12-09 16:24  labelImg-master\Makefile
     文件        1194  2016-12-09 16:24  labelImg-master\LICENSE.md
     文件       43167  2016-12-09 16:24  labelImg-master\labelImg.py
     文件          72  2016-12-09 16:24  labelImg-master\contributors.txt
     文件         225  2016-12-09 16:24  labelImg-master\.travis.yml
     文件         101  2016-12-09 16:24  labelImg-master\.gitignore
     文件       99198  2017-02-20 07:04  labelImg-master\resources.pyc
     目录           0  2016-12-12 15:22  labelImg-master\tests\
     文件         747  2016-12-09 16:24  labelImg-master\tests\臉書.jpg
     文件      263222  2016-12-09 16:24  labelImg-master\tests\test.bmp
     目录           0  2016-12-12 15:22  labelImg-master\libs\
     文件        1189  2016-12-12 14:52  labelImg-master\libs\zoomWidget.pyc
     文件         651  2016-12-09 16:24  labelImg-master\libs\zoomWidget.py
     文件        1759  2016-12-12 14:52  labelImg-master\libs\toolBar.pyc
     文件        1062  2016-12-09 16:24  labelImg-master\libs\toolBar.py
     文件        6099  2016-12-12 14:52  labelImg-master\libs\shape.pyc
     文件        5536  2016-12-09 16:24  labelImg-master\libs\shape.py
     文件        4904  2016-12-12 14:52  labelImg-master\libs\pascal_voc_io.pyc
     文件        4907  2016-12-09 16:24  labelImg-master\libs\pascal_voc_io.py
     文件        2584  2016-12-12 14:52  labelImg-master\libs\lib.pyc
     文件        1578  2016-12-09 16:24  labelImg-master\libs\lib.py
     文件        2659  2016-12-12 14:52  labelImg-master\libs\labelFile.pyc
     文件        2458  2016-12-09 16:24  labelImg-master\libs\labelFile.py
     文件        2512  2016-12-12 14:52  labelImg-master\libs\labelDialog.pyc
     文件        1746  2016-12-09 16:24  labelImg-master\libs\labelDialog.py
............此处省略51个文件信息

评论

共有 条评论