Commit 8a92775d authored by 武继龙's avatar 武继龙

modify input

parent e2f9c348
No preview for this file type
......@@ -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="203">
<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" />
......@@ -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="62" lean-forward="true" selection-start-line="62" selection-end-line="62" />
<state relative-caret-position="187">
<caret line="61" column="32" lean-forward="true" selection-start-line="61" selection-start-column="32" selection-end-line="61" selection-end-column="32" />
<folding>
<element signature="e#419#475#0" expanded="true" />
<element signature="e#419#484#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="111" />
<option name="y" value="31" />
<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="2002000" />
<option name="totallyTimeSpent" value="2968000" />
</component>
<component name="ToolWindowManager">
<frame x="40" y="111" width="1400" height="815" extended-state="0" />
<frame x="40" y="31" width="1400" height="815" extended-state="0" />
<editor active="true" />
<layout>
<window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.2533137" />
<window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.2569956" />
<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="1563430973365" 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="1563441173080" 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="62" lean-forward="true" selection-start-line="62" selection-end-line="62" />
<state relative-caret-position="187">
<caret line="61" column="32" lean-forward="true" selection-start-line="61" selection-start-column="32" selection-end-line="61" selection-end-column="32" />
<folding>
<element signature="e#419#475#0" expanded="true" />
<element signature="e#419#484#0" expanded="true" />
</folding>
</state>
</provider>
......
No preview for this file type
......@@ -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)
"""
......@@ -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
......
......@@ -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'],
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment