资源简介
人脸识别,图像标记,labelImg,代码,windows/Linux/mac os
代码片段和文件信息
#!/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.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__
__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
# PyQt5: TypeError: unhashable type: ‘QListWidgetItem‘
class HashableQListWidgetItem(QListWidgetItem):
def __init__(self *args):
super(HashableQListWidgetItem self).__init__(*args)
def __hash__(self):
return hash(id(self))
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
# Save a
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-04-29 15:27 labelImg-master\
文件 142 2018-04-29 15:27 labelImg-master\.gitignore
文件 2491 2018-04-29 15:27 labelImg-master\.travis.yml
文件 83 2018-04-29 15:27 labelImg-master\CONTRIBUTING.rst
文件 1022 2018-04-29 15:27 labelImg-master\HISTORY.rst
文件 1197 2018-04-29 15:27 labelImg-master\LICENSE
文件 300 2018-04-29 15:27 labelImg-master\MANIFEST.in
文件 381 2018-04-29 15:27 labelImg-master\Makefile
文件 8038 2018-04-29 15:27 labelImg-master\README.rst
文件 0 2018-04-29 15:27 labelImg-master\__init__.py
目录 0 2018-04-29 15:27 labelImg-master\build-tools\
文件 108 2018-04-29 15:27 labelImg-master\build-tools\.gitignore
文件 378 2018-04-29 15:27 labelImg-master\build-tools\README.md
文件 680 2018-04-29 15:27 labelImg-master\build-tools\build-for-pypi.sh
文件 656 2018-04-29 15:27 labelImg-master\build-tools\build-ubuntu-binary.sh
文件 882 2018-04-29 15:27 labelImg-master\build-tools\build-windows-binary.sh
文件 1566 2018-04-29 15:27 labelImg-master\build-tools\envsetup.sh
文件 383 2018-04-29 15:27 labelImg-master\build-tools\run-in-container.sh
目录 0 2018-04-29 15:27 labelImg-master\data\
文件 145 2018-04-29 15:27 labelImg-master\data\predefined_classes.txt
目录 0 2018-04-29 15:27 labelImg-master\demo\
文件 58243 2018-04-29 15:27 labelImg-master\demo\demo.jpg
文件 91238 2018-04-29 15:27 labelImg-master\demo\demo3.jpg
文件 2843527 2018-04-29 15:27 labelImg-master\demo\demo4.png
文件 3240759 2018-04-29 15:27 labelImg-master\demo\demo5.png
目录 0 2018-04-29 15:27 labelImg-master\icons\
文件 170413 2018-04-29 15:27 labelImg-master\icons\app.icns
文件 30534 2018-04-29 15:27 labelImg-master\icons\app.png
文件 2282 2018-04-29 15:27 labelImg-master\icons\app.svg
文件 2136 2018-04-29 15:27 labelImg-master\icons\cancel.png
文件 3111 2018-04-29 15:27 labelImg-master\icons\close.png
............此处省略66个文件信息
- 上一篇:学生管理 安卓APP
- 下一篇:《误差理论与数据处理(第6版)》费业泰-课后答案全
评论
共有 条评论