Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
EPSA Pae AI Self Driving
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
EPSA Personnal Git
EPSA Pae AI Self Driving
Commits
c2bf1a40
Commit
c2bf1a40
authored
Feb 28, 2023
by
Ouhouuhu
Browse files
Options
Downloads
Patches
Plain Diff
rotate image
parent
11ca2d9a
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/detection_custom.py
+2
-2
2 additions, 2 deletions
.../Yolo V3/TensorFlow-2.x-YOLOv3-master/detection_custom.py
PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/yolov3/utils.py
+5
-4
5 additions, 4 deletions
PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/yolov3/utils.py
with
7 additions
and
6 deletions
PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/detection_custom.py
+
2
−
2
View file @
c2bf1a40
...
...
@@ -20,9 +20,9 @@ image_path = "./Calibration_cam/2m.jpg"
video_path
=
"
./IMAGES/test.mp4
"
yolo
=
Load_Yolo_model
()
_
,
boxes
=
detect_image
(
yolo
,
image_path
,
"
./Calibration_cam/0.5_detect.jpg
"
,
input_size
=
YOLO_INPUT_SIZE
,
show
=
True
,
CLASSES
=
TRAIN_CLASSES
,
rectangle_colors
=
(
255
,
0
,
0
))
#
_, boxes = detect_image(yolo, image_path, "./Calibration_cam/0.5_detect.jpg", input_size=YOLO_INPUT_SIZE, show=True, CLASSES=TRAIN_CLASSES, rectangle_colors=(255,0,0))
#detect_video(yolo, video_path, './IMAGES/detected.mp4', input_size=YOLO_INPUT_SIZE, show=False, CLASSES=TRAIN_CLASSES, rectangle_colors=(255,0,0))
#
detect_realtime(yolo, '', input_size=YOLO_INPUT_SIZE, show=True, CLASSES=TRAIN_CLASSES, rectangle_colors=(255, 0, 0))
detect_realtime
(
yolo
,
''
,
input_size
=
YOLO_INPUT_SIZE
,
show
=
True
,
CLASSES
=
TRAIN_CLASSES
,
rectangle_colors
=
(
255
,
0
,
0
))
#detect_video_realtime_mp(video_path, "Output.mp4", input_size=YOLO_INPUT_SIZE, show=True, CLASSES=TRAIN_CLASSES, rectangle_colors=(255,0,0), realtime=False)
...
...
This diff is collapsed.
Click to expand it.
PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/yolov3/utils.py
+
5
−
4
View file @
c2bf1a40
...
...
@@ -210,7 +210,7 @@ def draw_bbox(image, bboxes,liste_pos_car=liste_pos((0,0,0),1), CLASSES=YOLO_COC
"""
x_car, y_car
"""
x_car
,
y_car
=
pos_car
[
0
],
pos_car
[
1
]
print
(
f
"
x:
{
x_car
}
, y:
{
y_car
}
"
)
x_car
,
y_car
=
(
x_car
-
1.2385
5
)
/
2.4
+
1
,
(
y_car
-
0.889
)
/
2.4
+
0.5
x_car
,
y_car
=
(
x_car
-
278
/
22
5
)
/
2.4
+
1
,
(
y_car
-
200
/
225
)
/
2.4
+
0.5
print
(
f
"
recalé x:
{
x_car
}
, y:
{
y_car
}
"
)
"""
loading trajectory
"""
#TODO: load it only once
...
...
@@ -219,7 +219,7 @@ def draw_bbox(image, bboxes,liste_pos_car=liste_pos((0,0,0),1), CLASSES=YOLO_COC
plt
.
plot
(
x_car
,
y_car
,
'
+
'
)
for
x
,
y
in
zip
(
cone_x
,
cone_y
):
x
,
y
=
(
x
-
1.2385
5
)
/
2.4
+
1
,
(
y
-
0.889
)
/
2.4
+
0.5
x
,
y
=
(
x
-
-
278
/
22
5
)
/
2.4
+
1
,
(
y
-
200
/
225
)
/
2.4
+
0.5
plt
.
plot
(
x
,
y
,
'
*
'
)
plt
.
plot
([
i
for
i
,
j
in
track_points
],
[
j
for
i
,
j
in
track_points
])
plt
.
show
()
...
...
@@ -589,7 +589,7 @@ def detect_realtime(Yolo, output_path, input_size=416, show=False, CLASSES=YOLO_
codec
=
cv2
.
VideoWriter_fourcc
(
*
'
XVID
'
)
out
=
cv2
.
VideoWriter
(
output_path
,
codec
,
fps
,
(
width
,
height
))
# output_path must be .mp4
liste_pos_car
=
liste_pos
((
1
,
0.
5
,
3.1415
/
2
),
50
)
liste_pos_car
=
liste_pos
((
278
/
225
,
200
/
22
5
,
3.1415
/
2
),
50
)
ser
=
get_ser
()
start_ser
(
ser
)
...
...
@@ -598,6 +598,7 @@ def detect_realtime(Yolo, output_path, input_size=416, show=False, CLASSES=YOLO_
while
True
:
ret
,
frame
=
vid
.
read
()
frame
=
np
.
rot90
(
frame
,
k
=
3
,
axes
=
(
0
,
1
))
try
:
original_frame
=
cv2
.
cvtColor
(
frame
,
cv2
.
COLOR_BGR2RGB
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment