Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
face_detect
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
jiajunjie
face_detect
Commits
57a4fbf5
Commit
57a4fbf5
authored
Jan 25, 2021
by
huangzhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
85c69ee6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
56 additions
and
17 deletions
+56
-17
hatdet.iml
examples/python/hatdet/.idea/hatdet.iml
+12
-0
misc.xml
examples/python/hatdet/.idea/misc.xml
+5
-0
modules.xml
examples/python/hatdet/.idea/modules.xml
+9
-0
workspace.xml
examples/python/hatdet/.idea/workspace.xml
+0
-0
darknet.cpython-35.pyc
examples/python/hatdet/__pycache__/darknet.cpython-35.pyc
+0
-0
darknet.py
examples/python/hatdet/darknet.py
+2
-1
darknet.pyc
examples/python/hatdet/darknet.pyc
+0
-0
test_darknet.py
examples/python/hatdet/test_darknet.py
+28
-16
ubotest.mp4
examples/python/hatdet/ubotest.mp4
+0
-0
No files found.
examples/python/hatdet/.idea/hatdet.iml
0 → 100644
View file @
57a4fbf5
<?xml version="1.0" encoding="UTF-8"?>
<module
type=
"PYTHON_MODULE"
version=
"4"
>
<component
name=
"NewModuleRootManager"
>
<content
url=
"file://$MODULE_DIR$"
/>
<orderEntry
type=
"jdk"
jdkName=
"Python 3.5.4 (~/anaconda2/envs/env-35/bin/python3.5)"
jdkType=
"Python SDK"
/>
<orderEntry
type=
"sourceFolder"
forTests=
"false"
/>
</component>
<component
name=
"TestRunnerService"
>
<option
name=
"PROJECT_TEST_RUNNER"
value=
"Unittests"
/>
</component>
</module>
\ No newline at end of file
examples/python/hatdet/.idea/misc.xml
0 → 100644
View file @
57a4fbf5
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"ProjectRootManager"
version=
"2"
project-jdk-name=
"Python 3.5.4 (~/anaconda2/envs/env-35/bin/python3.5)"
project-jdk-type=
"Python SDK"
/>
</project>
\ No newline at end of file
examples/python/hatdet/.idea/modules.xml
0 → 100644
View file @
57a4fbf5
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"ProjectModuleManager"
>
<modules>
<module
fileurl=
"file://$PROJECT_DIR$/.idea/hatdet.iml"
filepath=
"$PROJECT_DIR$/.idea/hatdet.iml"
/>
</modules>
</component>
</project>
\ No newline at end of file
examples/python/hatdet/.idea/workspace.xml
0 → 100644
View file @
57a4fbf5
This diff is collapsed.
Click to expand it.
examples/python/hatdet/__pycache__/darknet.cpython-35.pyc
View file @
57a4fbf5
No preview for this file type
examples/python/hatdet/darknet.py
View file @
57a4fbf5
...
@@ -86,4 +86,5 @@ class DarknetYolo:
...
@@ -86,4 +86,5 @@ class DarknetYolo:
k
=
k
+
1
k
=
k
+
1
return
lists
return
lists
else
:
else
:
print
(
"Cann't detect objects,please check image!"
)
#print("Cann't detect objects,please check image!")
return
[]
examples/python/hatdet/darknet.pyc
0 → 100644
View file @
57a4fbf5
File added
examples/python/hatdet/test_darknet.py
View file @
57a4fbf5
...
@@ -2,6 +2,9 @@ import cv2 as cv
...
@@ -2,6 +2,9 @@ import cv2 as cv
import
os.path
import
os.path
import
darknet
as
interface
import
darknet
as
interface
import
argparse
import
argparse
import
sys
import
time
import
datetime
configPath
=
'hat-obj-test.cfg'
configPath
=
'hat-obj-test.cfg'
...
@@ -54,22 +57,31 @@ while cv.waitKey(1) < 0:
...
@@ -54,22 +57,31 @@ while cv.waitKey(1) < 0:
cap
.
release
()
cap
.
release
()
break
break
detections_lists
=
[]
detections_lists
=
[]
t1
=
time
.
time
()
detections_lists
=
yolo
.
getdetresults
(
frame
)
detections_lists
=
yolo
.
getdetresults
(
frame
)
print
(
len
(
detections_lists
))
t
=
time
.
time
()
print
(
int
(
round
((
t
-
t1
)
*
1000
)))
for
i
in
range
(
len
(
detections_lists
)
):
# get x,y,w,h
if
detections_lists
:
x1
=
detections_lists
[
i
][
0
]
print
(
len
(
detections_lists
))
y1
=
detections_lists
[
i
][
1
]
for
i
in
range
(
len
(
detections_lists
)
):
x2
=
detections_lists
[
i
][
2
]
# get x,y,w,h
y2
=
detections_lists
[
i
][
3
]
x1
=
detections_lists
[
i
][
0
]
label
=
detections_lists
[
i
][
4
]
y1
=
detections_lists
[
i
][
1
]
confidence
=
detections_lists
[
i
][
5
]
x2
=
detections_lists
[
i
][
2
]
color
=
detections_lists
[
i
][
6
]
y2
=
detections_lists
[
i
][
3
]
label
=
detections_lists
[
i
][
4
]
confidence
=
detections_lists
[
i
][
5
]
color
=
detections_lists
[
i
][
6
]
cv
.
rectangle
(
frame
,
(
x1
,
y1
),
(
x2
,
y2
),
color
,
1
,
lineType
=
cv
.
LINE_AA
)
text
=
"{}: {:.4f}"
.
format
(
label
,
confidence
)
cv
.
putText
(
frame
,
text
,
(
x1
,
y1
-
5
),
cv
.
FONT_HERSHEY_SIMPLEX
,
0.5
,
color
,
1
,
lineType
=
cv
.
LINE_AA
)
else
:
print
(
0
)
cv
.
rectangle
(
frame
,
(
x1
,
y1
),
(
x2
,
y2
),
color
,
1
,
lineType
=
cv
.
LINE_AA
)
cv
.
imshow
(
"Tag"
,
frame
)
text
=
"{}: {:.4f}"
.
format
(
label
,
confidence
)
cv
.
putText
(
frame
,
text
,
(
x1
,
y1
-
5
),
cv
.
FONT_HERSHEY_SIMPLEX
,
0.5
,
color
,
1
,
lineType
=
cv
.
LINE_AA
)
cv
.
imshow
(
"Tag"
,
frame
)
#print(detections_lists)
#print(detections_lists)
examples/python/hatdet/ubotest.mp4
0 → 100644
View file @
57a4fbf5
File added
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