Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
O
onnx_model
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
武继龙
onnx_model
Commits
8a92775d
Commit
8a92775d
authored
Jul 18, 2019
by
武继龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify input
parent
e2f9c348
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
73 additions
and
65 deletions
+73
-65
.DS_Store
.DS_Store
+0
-0
workspace.xml
.idea/workspace.xml
+49
-55
.DS_Store
onnx_infer/.DS_Store
+0
-0
yolodata.cpython-37.pyc
onnx_infer/__pycache__/yolodata.cpython-37.pyc
+0
-0
main.py
onnx_infer/main.py
+16
-9
yolodata.py
onnx_infer/yolodata.py
+5
-0
setup.py
setup.py
+3
-1
No files found.
.DS_Store
View file @
8a92775d
No preview for this file type
.idea/workspace.xml
View file @
8a92775d
...
...
@@ -3,7 +3,8 @@
<component
name=
"ChangeListManager"
>
<list
default=
"true"
id=
"c99523d9-010f-4b7a-8f3f-0e626959dd1a"
name=
"Default Changelist"
comment=
""
>
<change
beforePath=
"$PROJECT_DIR$/onnx_infer/main.py"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/onnx_infer/main.py"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/onnx_infer/supression.py"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/onnx_infer/supression.py"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/onnx_infer/yolodata.py"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/onnx_infer/yolodata.py"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/setup.py"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/setup.py"
afterDir=
"false"
/>
</list>
<option
name=
"EXCLUDED_CONVERTED_TO_IGNORED"
value=
"true"
/>
<option
name=
"SHOW_DIALOG"
value=
"false"
/>
...
...
@@ -12,12 +13,12 @@
<option
name=
"LAST_RESOLUTION"
value=
"IGNORE"
/>
</component>
<component
name=
"FileEditorManager"
>
<leaf>
<leaf
SIDE_TABS_SIZE_LIMIT_KEY=
"300"
>
<file
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/onnx_infer/supression.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
119
"
>
<caret
line=
"22"
lean-forward=
"true"
selection-start-line=
"22"
selection-end-line=
"22"
/>
<state
relative-caret-position=
"
361
"
>
<caret
line=
"22"
selection-start-line=
"22"
selection-end-line=
"22"
/>
<folding>
<element
signature=
"e#0#18#0"
expanded=
"true"
/>
</folding>
...
...
@@ -28,7 +29,8 @@
<file
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/onnx_infer/yolodata.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state>
<state
relative-caret-position=
"456"
>
<caret
line=
"24"
column=
"24"
lean-forward=
"true"
selection-start-line=
"24"
selection-start-column=
"24"
selection-end-line=
"24"
selection-end-column=
"24"
/>
<folding>
<element
signature=
"e#0#21#0"
expanded=
"true"
/>
</folding>
...
...
@@ -39,7 +41,7 @@
<file
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/onnx_infer/yolo3/model.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"2
03
"
>
<state
relative-caret-position=
"2
926
"
>
<caret
line=
"165"
selection-start-line=
"165"
selection-end-line=
"165"
/>
<folding>
<element
signature=
"e#0#27#0"
expanded=
"true"
/>
...
...
@@ -50,9 +52,7 @@
</file>
<file
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/onnx_infer/yolo3/utils.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"-208"
/>
</provider>
<provider
selected=
"true"
editor-type-id=
"text-editor"
/>
</entry>
</file>
<file
pinned=
"false"
current-in-tab=
"false"
>
...
...
@@ -63,7 +63,7 @@
<file
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/onnx_infer/color.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"-531"
>
<state>
<folding>
<element
signature=
"e#0#32#0"
expanded=
"true"
/>
</folding>
...
...
@@ -84,10 +84,10 @@
<file
pinned=
"false"
current-in-tab=
"true"
>
<entry
file=
"file://$PROJECT_DIR$/onnx_infer/main.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
282
"
>
<caret
line=
"6
2"
lean-forward=
"true"
selection-start-line=
"62"
selection-end-line=
"6
2"
/>
<state
relative-caret-position=
"
187
"
>
<caret
line=
"6
1"
column=
"32"
lean-forward=
"true"
selection-start-line=
"61"
selection-start-column=
"32"
selection-end-line=
"61"
selection-end-column=
"3
2"
/>
<folding>
<element
signature=
"e#419#4
75
#0"
expanded=
"true"
/>
<element
signature=
"e#419#4
84
#0"
expanded=
"true"
/>
</folding>
</state>
</provider>
...
...
@@ -112,14 +112,15 @@
<component
name=
"IdeDocumentHistory"
>
<option
name=
"CHANGED_PATHS"
>
<list>
<option
value=
"$PROJECT_DIR$/onnx_infer/main.py"
/>
<option
value=
"$PROJECT_DIR$/onnx_infer/supression.py"
/>
<option
value=
"$PROJECT_DIR$/onnx_infer/yolodata.py"
/>
<option
value=
"$PROJECT_DIR$/onnx_infer/main.py"
/>
</list>
</option>
</component>
<component
name=
"ProjectFrameBounds"
>
<option
name=
"x"
value=
"40"
/>
<option
name=
"y"
value=
"
11
1"
/>
<option
name=
"y"
value=
"
3
1"
/>
<option
name=
"width"
value=
"1400"
/>
<option
name=
"height"
value=
"815"
/>
</component>
...
...
@@ -140,12 +141,6 @@
<item
name=
"onnx"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"onnx_infer"
type=
"462c0819:PsiDirectoryNode"
/>
</path>
<path>
<item
name=
"onnx"
type=
"b2602c69:ProjectViewProjectNode"
/>
<item
name=
"onnx"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"onnx_infer"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"model_data"
type=
"462c0819:PsiDirectoryNode"
/>
</path>
<path>
<item
name=
"onnx"
type=
"b2602c69:ProjectViewProjectNode"
/>
<item
name=
"onnx"
type=
"462c0819:PsiDirectoryNode"
/>
...
...
@@ -160,6 +155,7 @@
</panes>
</component>
<component
name=
"PropertiesComponent"
>
<property
name=
"SHARE_PROJECT_CONFIGURATION_FILES"
value=
"true"
/>
<property
name=
"WebServerToolWindowFactoryState"
value=
"false"
/>
<property
name=
"node.js.detected.package.eslint"
value=
"true"
/>
<property
name=
"node.js.detected.package.tslint"
value=
"true"
/>
...
...
@@ -246,22 +242,23 @@
<updated>
1563429063264
</updated>
<workItem
from=
"1563429064722"
duration=
"31000"
/>
<workItem
from=
"1563429380140"
duration=
"1971000"
/>
<workItem
from=
"1563440209053"
duration=
"966000"
/>
</task>
<servers
/>
</component>
<component
name=
"TimeTrackingManager"
>
<option
name=
"totallyTimeSpent"
value=
"2
002
000"
/>
<option
name=
"totallyTimeSpent"
value=
"2
968
000"
/>
</component>
<component
name=
"ToolWindowManager"
>
<frame
x=
"40"
y=
"
11
1"
width=
"1400"
height=
"815"
extended-state=
"0"
/>
<frame
x=
"40"
y=
"
3
1"
width=
"1400"
height=
"815"
extended-state=
"0"
/>
<editor
active=
"true"
/>
<layout>
<window_info
content_ui=
"combo"
id=
"Project"
order=
"0"
visible=
"true"
weight=
"0.25
33137
"
/>
<window_info
content_ui=
"combo"
id=
"Project"
order=
"0"
visible=
"true"
weight=
"0.25
69956
"
/>
<window_info
id=
"Structure"
order=
"1"
side_tool=
"true"
weight=
"0.25"
/>
<window_info
id=
"Favorites"
order=
"2"
side_tool=
"true"
/>
<window_info
anchor=
"bottom"
id=
"Message"
order=
"0"
/>
<window_info
anchor=
"bottom"
id=
"Find"
order=
"1"
/>
<window_info
anchor=
"bottom"
id=
"Run"
order=
"2"
weight=
"0.
5504841
"
/>
<window_info
anchor=
"bottom"
id=
"Run"
order=
"2"
weight=
"0.
34024897
"
/>
<window_info
anchor=
"bottom"
id=
"Debug"
order=
"3"
weight=
"0.4"
/>
<window_info
anchor=
"bottom"
id=
"Cvs"
order=
"4"
weight=
"0.25"
/>
<window_info
anchor=
"bottom"
id=
"Inspection"
order=
"5"
weight=
"0.4"
/>
...
...
@@ -284,23 +281,39 @@
</component>
<component
name=
"com.intellij.coverage.CoverageDataManagerImpl"
>
<SUITE
FILE_PATH=
"coverage/onnx$supression.coverage"
NAME=
"supression Coverage Results"
MODIFIED=
"1563430968413"
SOURCE_PROVIDER=
"com.intellij.coverage.DefaultCoverageFileProvider"
RUNNER=
"coverage.py"
COVERAGE_BY_TEST_ENABLED=
"true"
COVERAGE_TRACING_ENABLED=
"false"
WORKING_DIRECTORY=
"$PROJECT_DIR$/onnx_infer"
/>
<SUITE
FILE_PATH=
"coverage/onnx$main.coverage"
NAME=
"main Coverage Results"
MODIFIED=
"15634
30973365
"
SOURCE_PROVIDER=
"com.intellij.coverage.DefaultCoverageFileProvider"
RUNNER=
"coverage.py"
COVERAGE_BY_TEST_ENABLED=
"true"
COVERAGE_TRACING_ENABLED=
"false"
WORKING_DIRECTORY=
"$PROJECT_DIR$/onnx_infer"
/>
<SUITE
FILE_PATH=
"coverage/onnx$main.coverage"
NAME=
"main Coverage Results"
MODIFIED=
"15634
41173080
"
SOURCE_PROVIDER=
"com.intellij.coverage.DefaultCoverageFileProvider"
RUNNER=
"coverage.py"
COVERAGE_BY_TEST_ENABLED=
"true"
COVERAGE_TRACING_ENABLED=
"false"
WORKING_DIRECTORY=
"$PROJECT_DIR$/onnx_infer"
/>
</component>
<component
name=
"editorHistoryManager"
>
<entry
file=
"file://$PROJECT_DIR$/onnx_infer/model_data/yolo_anchors.txt"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
/>
<entry
file=
"file://$PROJECT_DIR$/onnx_infer/model_data/yolo_anchors.txt"
/>
<entry
file=
"file://$PROJECT_DIR$/onnx_infer/supression.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"361"
>
<caret
line=
"22"
selection-start-line=
"22"
selection-end-line=
"22"
/>
<folding>
<element
signature=
"e#0#18#0"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/onnx_infer/yolo3/
utils
.py"
>
<entry
file=
"file://$PROJECT_DIR$/onnx_infer/yolo3/
model
.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"-208"
/>
<state
relative-caret-position=
"2926"
>
<caret
line=
"165"
selection-start-line=
"165"
selection-end-line=
"165"
/>
<folding>
<element
signature=
"e#0#27#0"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/onnx_infer/yolo3/utils.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
/>
</entry>
<entry
file=
"file://$PROJECT_DIR$/onnx_infer/__init__.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
/>
</entry>
<entry
file=
"file://$PROJECT_DIR$/onnx_infer/color.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"-531"
>
<state>
<folding>
<element
signature=
"e#0#32#0"
expanded=
"true"
/>
</folding>
...
...
@@ -324,39 +337,20 @@
</entry>
<entry
file=
"file://$PROJECT_DIR$/onnx_infer/yolodata.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state>
<state
relative-caret-position=
"456"
>
<caret
line=
"24"
column=
"24"
lean-forward=
"true"
selection-start-line=
"24"
selection-start-column=
"24"
selection-end-line=
"24"
selection-end-column=
"24"
/>
<folding>
<element
signature=
"e#0#21#0"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/onnx_infer/yolo3/model.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"203"
>
<caret
line=
"165"
selection-start-line=
"165"
selection-end-line=
"165"
/>
<folding>
<element
signature=
"e#0#27#0"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/onnx_infer/supression.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"119"
>
<caret
line=
"22"
lean-forward=
"true"
selection-start-line=
"22"
selection-end-line=
"22"
/>
<folding>
<element
signature=
"e#0#18#0"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/onnx_infer/main.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
282
"
>
<caret
line=
"6
2"
lean-forward=
"true"
selection-start-line=
"62"
selection-end-line=
"6
2"
/>
<state
relative-caret-position=
"
187
"
>
<caret
line=
"6
1"
column=
"32"
lean-forward=
"true"
selection-start-line=
"61"
selection-start-column=
"32"
selection-end-line=
"61"
selection-end-column=
"3
2"
/>
<folding>
<element
signature=
"e#419#4
75
#0"
expanded=
"true"
/>
<element
signature=
"e#419#4
84
#0"
expanded=
"true"
/>
</folding>
</state>
</provider>
...
...
onnx_infer/.DS_Store
View file @
8a92775d
No preview for this file type
onnx_infer/__pycache__/yolodata.cpython-37.pyc
View file @
8a92775d
No preview for this file type
onnx_infer/main.py
View file @
8a92775d
...
...
@@ -8,22 +8,22 @@ the result of this is the category and bounding box which is the max score.
"""
#*******************
from
yolodata
import
path2Img
,
letterbox_image
,
path2arr
from
yolodata
import
path2Img
,
letterbox_image
,
path2arr
,
arr2Img
from
onnx2kera
import
onnxinfere
from
supression
import
Supress
import
tensorflow
as
tf
from
color
import
COLORS
,
featureTransform
,
resize
,
get_color
from
croppic
import
cropImage
import
cv2
#global
categorys
=
[
'long sleeve dress'
,
'vest dress'
,
'vest'
,
'long sleeve outwear'
,
'long sleeve top'
,
'trousers'
,
'short sleeve top'
,
'sling dress'
,
'skirt'
,
'short sleeve dress'
,
'shorts'
]
class
Main
:
def
__init__
(
self
,
colorOnnx_path
,
yoloOnnx_path
,
image_
path
):
def
__init__
(
self
,
colorOnnx_path
,
yoloOnnx_path
,
image_
arr
):
self
.
colorOnnx_path
=
colorOnnx_path
self
.
yoloOnnx_path
=
yoloOnnx_path
self
.
image_
path
=
image_path
self
.
image_
arr
=
image_arr
self
.
score
=
0.05
self
.
iou
=
0.05
self
.
picSize
=
(
416
,
416
)
...
...
@@ -32,7 +32,7 @@ class Main:
def
bboxAndcategory
(
self
):
bbox
=
[]
category
=
[]
image
=
path2Img
(
self
.
image_path
)
image
=
arr2Img
(
self
.
image_arr
)
image_data
=
letterbox_image
(
image
,
self
.
picSize
)
precit
=
onnxinfere
(
self
.
yoloOnnx_path
,
image_data
)
feature
=
[]
...
...
@@ -47,7 +47,7 @@ class Main:
def
colorAndbboxAndcategory
(
self
):
bbox
,
category
=
self
.
bboxAndcategory
()
image_arr
=
path2arr
(
self
.
image_path
)
image_arr
=
self
.
image_arr
image_crop
=
cropImage
(
image_arr
,
bbox
)
resized
=
resize
(
image_crop
)
tmp
=
featureTransform
(
resized
)
...
...
@@ -56,8 +56,8 @@ class Main:
# main test
def
get_result
(
colorOnnx_path
,
yoloOnnx_path
,
image_
path
):
m
=
Main
(
colorOnnx_path
,
yoloOnnx_path
,
image_
path
)
def
get_result
(
colorOnnx_path
,
yoloOnnx_path
,
image_
arr
):
m
=
Main
(
colorOnnx_path
,
yoloOnnx_path
,
image_
arr
)
color
,
bbox
,
category
=
m
.
colorAndbboxAndcategory
()
return
color
,
bbox
,
category
...
...
@@ -66,6 +66,13 @@ if __name__ == '__main__':
colorOnnx_path
=
'/Users/apple/Desktop/color.onnx'
image_path
=
'/Users/apple/Desktop/8.jpg'
yoloOnnx_path
=
'/Users/apple/Desktop/yolo3.onnx'
image_arr
=
cv2
.
imread
(
image_path
)
color
,
bbox
,
category
=
get_result
(
colorOnnx_path
,
yoloOnnx_path
,
image_arr
)
print
(
color
)
print
(
bbox
)
print
(
category
)
"""
m = Main(colorOnnx_path, yoloOnnx_path, image_path)
color, bbox, category = m.colorAndbboxAndcategory()
print('its color is : {}, category is : {} '.format(color, category))
...
...
@@ -73,4 +80,4 @@ if __name__ == '__main__':
# print(color)
# print(bbox)
# print(category)
"""
onnx_infer/yolodata.py
View file @
8a92775d
...
...
@@ -12,6 +12,11 @@ def path2arr(path):
image
=
cv2
.
imread
(
path
,
cv2
.
IMREAD_COLOR
)
return
image
def
arr2Img
(
image_arr
):
image
=
Image
.
fromarray
(
image_arr
)
return
image
# this image is one Image type
def
letterbox_image
(
image
,
size
):
iw
,
ih
=
image
.
size
h
,
w
=
size
...
...
setup.py
View file @
8a92775d
...
...
@@ -10,7 +10,9 @@ setup(
url
=
'http://git.wanmeizhensuo.com/wujilong/onnx_model.git'
,
author_email
=
'wujilong@igengmei.com'
,
license
=
'MIT'
,
packages
=
[
'onnx_infer'
,
'onnx_infer.yolo3'
],
packages
=
[
'onnx_infer.color'
,
onnx_infer
.
croppic
,
onnx_infer
.
drawpic
,
'onnx_infer.main'
,
'onnx_infer.onnx2kera'
,
'onnx_infer.supression'
,
'onnx_infer.yolodata'
,
'onnx_infer.yolo3.model'
,
'onnx_infer.yolo3.utils'
],
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment