mirror of
https://github.com/opencv/opencv.git
synced 2025-06-07 01:13:28 +08:00
Use ==/!= to compare constant literals (str, bytes, int, float, tuple)
Avoid `SyntaxWarning` on Python >= 3.8 ``` >>> "convolutional" == "convolutional" True >>> "convolutional" is "convolutional" <stdin>:1: SyntaxWarning: "is" with a literal. Did you mean "=="? True ``` Related to #21121
This commit is contained in:
parent
2c226d597d
commit
9cc60c9dd3
@ -270,12 +270,12 @@ def createSSDGraph(modelPath, configPath, outputPath):
|
||||
addConstNode('concat/axis_flatten', [-1], graph_def)
|
||||
addConstNode('PriorBox/concat/axis', [-2], graph_def)
|
||||
|
||||
for label in ['ClassPredictor', 'BoxEncodingPredictor' if box_predictor is 'convolutional' else 'BoxPredictor']:
|
||||
for label in ['ClassPredictor', 'BoxEncodingPredictor' if box_predictor == 'convolutional' else 'BoxPredictor']:
|
||||
concatInputs = []
|
||||
for i in range(num_layers):
|
||||
# Flatten predictions
|
||||
flatten = NodeDef()
|
||||
if box_predictor is 'convolutional':
|
||||
if box_predictor == 'convolutional':
|
||||
inpName = 'BoxPredictor_%d/%s/BiasAdd' % (i, label)
|
||||
else:
|
||||
if i == 0:
|
||||
@ -308,7 +308,7 @@ def createSSDGraph(modelPath, configPath, outputPath):
|
||||
priorBox = NodeDef()
|
||||
priorBox.name = 'PriorBox_%d' % i
|
||||
priorBox.op = 'PriorBox'
|
||||
if box_predictor is 'convolutional':
|
||||
if box_predictor == 'convolutional':
|
||||
priorBox.input.append('BoxPredictor_%d/BoxEncodingPredictor/BiasAdd' % i)
|
||||
else:
|
||||
if i == 0:
|
||||
|
Loading…
Reference in New Issue
Block a user