Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
inovisao
exemplos_visgpt
Commits
cef32568
Commit
cef32568
authored
1 year ago
by
Hemerson Pistori
Browse files
Options
Download
Email Patches
Plain Diff
Está sorteando os objetos corretamente agora
parent
1b687e3a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
aumento_dados_coco.py
aumento_dados_coco.py
+7
-5
No files found.
aumento_dados_coco.py
View file @
cef32568
...
...
@@ -76,6 +76,9 @@ licenses = [{
"name"
:
"Attribution License"
,
}]
# Pega a lista de objetos disponíveis
objetos
=
os
.
listdir
(
OBJETOS_DIR
)
for
fundo
in
os
.
listdir
(
FUNDOS_DIR
):
print
(
"Gerando variações para o fundo "
,
fundo
)
...
...
@@ -83,11 +86,6 @@ for fundo in os.listdir(FUNDOS_DIR):
i_img
=
len
(
coco
.
imgs
)
+
1
print
(
"Criando imagem "
+
str
(
i_img
))
# Seleciona uma imagem aleatória do diretórios de objetos
objetos
=
os
.
listdir
(
OBJETOS_DIR
)
objeto
=
random
.
choice
(
objetos
)
# Coloca em IMG_PATH o caminho completo da imagem do objeto
IMG_PATH
=
OBJETOS_DIR
+
"/"
+
objeto
# Carrega a imagem de fundo de dentro da pasta FUNDOS_DIR usando o OpenCV
img
=
cv2
.
imread
(
FUNDOS_DIR
+
"/"
+
fundo
)
...
...
@@ -125,6 +123,10 @@ for fundo in os.listdir(FUNDOS_DIR):
# Imprime j seguido de '...' sem pular de linha
print
(
j
+
1
,
end
=
"..."
)
objeto
=
random
.
choice
(
objetos
)
# Coloca em IMG_PATH o caminho completo da imagem do objeto
IMG_PATH
=
OBJETOS_DIR
+
"/"
+
objeto
# Cria variações do objeto
response
=
openai
.
Image
.
create_variation
(
...
...
This diff is collapsed.
Click to expand it.
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