Skip to content

Commit

Permalink
Merge pull request #1 from PaddlePaddle/dygraph
Browse files Browse the repository at this point in the history
Dygraph
  • Loading branch information
HexToString committed May 21, 2021
2 parents 32665fe + 58794e0 commit 6893d15
Show file tree
Hide file tree
Showing 239 changed files with 30,738 additions and 11,620 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,8 @@ output/

build/
dist/
paddleocr.egg-info/
paddleocr.egg-info/
/deploy/android_demo/app/OpenCV/
/deploy/android_demo/app/PaddleLite/
/deploy/android_demo/app/.cxx/
/deploy/android_demo/app/cache/
3 changes: 2 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ include README.md
recursive-include ppocr/utils *.txt utility.py logging.py
recursive-include ppocr/data/ *.py
recursive-include ppocr/postprocess *.py
recursive-include tools/infer *.py
recursive-include tools/infer *.py
recursive-include ppocr/utils/e2e_utils/ *.py
30 changes: 20 additions & 10 deletions PPOCRLabel/PPOCRLabel.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ def __init__(self, lang="ch", defaultFilename=None, defaultPrefdefClassFile=None
self.itemsToShapesbox = {}
self.shapesToItemsbox = {}
self.prevLabelText = getStr('tempLabel')
self.noLabelText = getStr('nullLabel')
self.model = 'paddle'
self.PPreader = None
self.autoSaveNum = 5
Expand Down Expand Up @@ -1020,7 +1021,7 @@ def singleLabel(self, shape):
item.setText(str([(int(p.x()), int(p.y())) for p in shape.points]))
self.updateComboBox()

def updateComboBox(self): # TODO:貌似没用
def updateComboBox(self):
# Get the unique labels and add them to the Combobox.
itemsTextList = [str(self.labelList.item(i).text()) for i in range(self.labelList.count())]

Expand All @@ -1040,7 +1041,7 @@ def format_shape(s):
return dict(label=s.label, # str
line_color=s.line_color.getRgb(),
fill_color=s.fill_color.getRgb(),
points=[(p.x(), p.y()) for p in s.points], # QPonitF
points=[(int(p.x()), int(p.y())) for p in s.points], # QPonitF
# add chris
difficult=s.difficult) # bool

Expand Down Expand Up @@ -1069,7 +1070,7 @@ def format_shape(s):
# print('Image:{0} -> Annotation:{1}'.format(self.filePath, annotationFilePath))
return True
except:
self.errorMessage(u'Error saving label data')
self.errorMessage(u'Error saving label data', u'Error saving label data')
return False

def copySelectedShape(self):
Expand Down Expand Up @@ -1802,10 +1803,14 @@ def reRecognition(self):
result.insert(0, box)
print('result in reRec is ', result)
self.result_dic.append(result)
if result[1][0] == shape.label:
print('label no change')
else:
rec_flag += 1
else:
print('Can not recognise the box')
self.result_dic.append([box,(self.noLabelText,0)])

if self.noLabelText == shape.label or result[1][0] == shape.label:
print('label no change')
else:
rec_flag += 1

if len(self.result_dic) > 0 and rec_flag > 0:
self.saveFile(mode='Auto')
Expand Down Expand Up @@ -1836,9 +1841,14 @@ def singleRerecognition(self):
print('label no change')
else:
shape.label = result[1][0]
self.singleLabel(shape)
self.setDirty()
print(box)
else:
print('Can not recognise the box')
if self.noLabelText == shape.label:
print('label no change')
else:
shape.label = self.noLabelText
self.singleLabel(shape)
self.setDirty()

def autolcm(self):
vbox = QVBoxLayout()
Expand Down
4 changes: 1 addition & 3 deletions PPOCRLabel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ PaddleOCR models has been built in PPOCRLabel, please refer to [PaddleOCR instal

### 2. Install PPOCRLabel

#### Windows + Anaconda

Download and install [Anaconda](https://www.anaconda.com/download/#download) (Python 3+)
#### Windows

```
pip install pyqt5
Expand Down
2 changes: 1 addition & 1 deletion PPOCRLabel/README_ch.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ PPOCRLabel是一款适用于OCR领域的半自动化图形标注工具,内置P
PPOCRLabel内置PaddleOCR模型,故请参考[PaddleOCR安装文档](https://github.com/PaddlePaddle/PaddleOCR/blob/develop/doc/doc_ch/installation.md)准备好PaddleOCR,并确保PaddleOCR安装成功。

### 2. 安装PPOCRLabel
#### Windows + Anaconda
#### Windows

```
pip install pyqt5
Expand Down
2 changes: 1 addition & 1 deletion PPOCRLabel/libs/canvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class Canvas(QWidget):
CREATE, EDIT = list(range(2))
_fill_drawing = False # draw shadows

epsilon = 11.0
epsilon = 5.0

def __init__(self, *args, **kwargs):
super(Canvas, self).__init__(*args, **kwargs)
Expand Down

0 comments on commit 6893d15

Please sign in to comment.