Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RAVEN2YOLO
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stephane Chavin
RAVEN2YOLO
Commits
42d80066
Commit
42d80066
authored
11 months ago
by
Stephane Chavin
Browse files
Options
Downloads
Patches
Plain Diff
correction
parent
e39c1565
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
get_train_annot.py
+3
-1
3 additions, 1 deletion
get_train_annot.py
get_train_val.py
+1
-3
1 addition, 3 deletions
get_train_val.py
utils.py
+1
-0
1 addition, 0 deletions
utils.py
with
5 additions
and
4 deletions
get_train_annot.py
+
3
−
1
View file @
42d80066
...
@@ -105,6 +105,8 @@ def process(entry, arguments, species_list):
...
@@ -105,6 +105,8 @@ def process(entry, arguments, species_list):
for
specie_num
in
species_list
[
species_list
.
columns
[
0
]]:
for
specie_num
in
species_list
[
species_list
.
columns
[
0
]]:
utils
.
create_directory
(
os
.
path
.
join
(
utils
.
create_directory
(
os
.
path
.
join
(
arguments
.
directory
,
'
images
'
,
str
(
specie_num
)))
arguments
.
directory
,
'
images
'
,
str
(
specie_num
)))
utils
.
create_directory
(
os
.
path
.
join
(
arguments
.
directory
,
'
annotated_images
'
,
str
(
specie_num
)))
# Save the images and annotation
# Save the images and annotation
plt
.
savefig
(
os
.
path
.
join
(
arguments
.
directory
,
plt
.
savefig
(
os
.
path
.
join
(
arguments
.
directory
,
'
images
'
,
'
images
'
,
...
@@ -233,7 +235,7 @@ if __name__ == '__main__':
...
@@ -233,7 +235,7 @@ if __name__ == '__main__':
# Get the current path to find the split script
# Get the current path to find the split script
script
=
os
.
path
.
join
(
path
,
'
get_train_val.py
'
)
script
=
os
.
path
.
join
(
path
,
'
get_train_val.py
'
)
data_path
=
os
.
path
.
join
(
path
,
args
.
directory
,
'
labels
'
)
data_path
=
os
.
path
.
join
(
path
,
args
.
directory
,
'
labels
'
)
directory_path
=
os
.
path
.
join
(
path
,
args
.
directory
,
'
set
'
)
directory_path
=
os
.
path
.
join
(
path
,
args
.
directory
)
# Create the directory path if not exists
# Create the directory path if not exists
utils
.
create_directory
(
directory_path
)
utils
.
create_directory
(
directory_path
)
try
:
try
:
...
...
This diff is collapsed.
Click to expand it.
get_train_val.py
+
1
−
3
View file @
42d80066
...
@@ -60,8 +60,7 @@ def export_split(argument, entry, path, directory):
...
@@ -60,8 +60,7 @@ def export_split(argument, entry, path, directory):
f
.
write
(
f
'
train:
{
os
.
path
.
join
(
directory
,
"
images/train
"
)
}
\n
'
)
f
.
write
(
f
'
train:
{
os
.
path
.
join
(
directory
,
"
images/train
"
)
}
\n
'
)
f
.
write
(
f
'
val:
{
os
.
path
.
join
(
directory
,
"
images/val
"
)
}
\n
'
)
f
.
write
(
f
'
val:
{
os
.
path
.
join
(
directory
,
"
images/val
"
)
}
\n
'
)
f
.
write
(
f
'
nc:
{
len
(
species_list
)
}
\n
'
)
f
.
write
(
f
'
nc:
{
len
(
species_list
)
}
\n
'
)
f
.
write
(
f
'
names:
{
species_list
.
species
.
tolist
()
}
'
)
f
.
write
(
f
'
names:
{
[
str
(
x
)
for
x
in
species_list
.
species
.
tolist
()]
}
'
)
def
prepare_data
(
arguments
):
def
prepare_data
(
arguments
):
"""
"""
...
@@ -115,7 +114,6 @@ if __name__ == '__main__':
...
@@ -115,7 +114,6 @@ if __name__ == '__main__':
current_path
=
os
.
getcwd
()
current_path
=
os
.
getcwd
()
directory_path
=
os
.
path
.
join
(
current_path
,
args
.
directory
,
'
set
'
)
directory_path
=
os
.
path
.
join
(
current_path
,
args
.
directory
,
'
set
'
)
yolo_path
=
os
.
path
.
join
(
current_path
,
'
yolov5/train.py
'
)
yolo_path
=
os
.
path
.
join
(
current_path
,
'
yolov5/train.py
'
)
data_path
=
os
.
path
.
join
(
directory_path
,
'
custom_data.yaml
'
)
data_path
=
os
.
path
.
join
(
directory_path
,
'
custom_data.yaml
'
)
weights_path
=
os
.
path
.
join
(
current_path
,
'
yolov5/weights/yolov5l.pt
'
)
weights_path
=
os
.
path
.
join
(
current_path
,
'
yolov5/weights/yolov5l.pt
'
)
...
...
This diff is collapsed.
Click to expand it.
utils.py
+
1
−
0
View file @
42d80066
...
@@ -343,6 +343,7 @@ def prepare_dataframe(df, args):
...
@@ -343,6 +343,7 @@ def prepare_dataframe(df, args):
species_list
=
df
.
groupby
(
'
species
'
).
size
().
sort_values
(
species_list
=
df
.
groupby
(
'
species
'
).
size
().
sort_values
(
ascending
=
False
).
reset_index
()
ascending
=
False
).
reset_index
()
species_list
.
columns
=
[
'
specie
'
,
'
number
'
]
df
[
'
d_annot
'
]
=
df
.
stop
-
df
.
start
df
[
'
d_annot
'
]
=
df
.
stop
-
df
.
start
df
[
'
midl
'
]
=
(
df
.
stop
+
df
.
start
)
/
2
df
[
'
midl
'
]
=
(
df
.
stop
+
df
.
start
)
/
2
...
...
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
register
or
sign in
to comment