Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
6f89209
updates for using the NVIDIA Docker command instead of vanilla docker
monocongo Sep 1, 2019
8cae75b
fixed to be an actual/valid .gitignore file
monocongo Sep 1, 2019
337fd08
setup.py for installation and containing a console script entry point
monocongo Sep 1, 2019
6a3e3e8
updated package requirements, the result from `pip freeze > requireme…
monocongo Sep 1, 2019
6ca362e
updates for installation requirements
monocongo Sep 1, 2019
1219d0a
removed unused import
monocongo Sep 2, 2019
3a058e8
formatting for better PEP8 compliance
monocongo Sep 2, 2019
5532d67
removed unused imports
monocongo Sep 2, 2019
16d0e72
renamed modules to oidv4_toolkit
monocongo Sep 7, 2019
91556a5
commented out some code that is apparently for status messages and wh…
monocongo Sep 7, 2019
ec75ec5
Merge pull request #1 from monocongo/issue_334_replace_formatted_stri…
monocongo Sep 8, 2019
99a6341
Bump rsa from 3.4.2 to 4.1
dependabot[bot] Mar 24, 2021
8a575f6
Merge pull request #2 from monocongo/dependabot/pip/rsa-4.1
monocongo Apr 28, 2021
63977d4
Bump pyyaml from 5.1.2 to 5.4
dependabot[bot] Apr 28, 2021
83e6655
Merge pull request #3 from monocongo/dependabot/pip/pyyaml-5.4
monocongo Apr 28, 2021
3a4ae2d
Bump urllib3 from 1.25.3 to 1.25.8
dependabot[bot] Apr 30, 2021
c16bfa5
Merge pull request #5 from monocongo/dependabot/pip/urllib3-1.25.8
monocongo May 4, 2021
3ff200b
Bump rsa from 4.1 to 4.7
dependabot[bot] May 4, 2021
c381993
Merge pull request #4 from monocongo/dependabot/pip/rsa-4.7
monocongo May 5, 2021
023dbb9
Bump urllib3 from 1.25.8 to 1.26.5
dependabot[bot] Jun 2, 2021
6c16b5b
Merge pull request #6 from monocongo/dependabot/pip/urllib3-1.26.5
monocongo Jul 6, 2021
24b12a1
updated the OpenCV version
monocongo Oct 14, 2021
8e458ca
Bump numpy from 1.17.1 to 1.22.0
dependabot[bot] Jun 22, 2022
759bb4f
Merge pull request #9 from monocongo/dependabot/pip/numpy-1.22.0
monocongo Jul 18, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,819 changes: 107 additions & 1,712 deletions .gitignore

Large diffs are not rendered by default.

12 changes: 3 additions & 9 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,9 @@
Usage:
refer to README.md file
"""
from sys import exit
from textwrap import dedent
from modules.parser import *
from modules.utils import *
from modules.downloader import *
from modules.show import *
from modules.csv_downloader import *
from modules.bounding_boxes import *
from modules.image_level import *
from oidv4_toolkit.parser import *
from oidv4_toolkit.bounding_boxes import *
from oidv4_toolkit.image_level import *


ROOT_DIR = ''
Expand Down
155 changes: 0 additions & 155 deletions modules/image_level.py

This file was deleted.

Empty file added oidv4_toolkit/__init__.py
Empty file.
23 changes: 23 additions & 0 deletions oidv4_toolkit/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import os

from oidv4_toolkit.parser import parser_arguments
from oidv4_toolkit.bounding_boxes import bounding_boxes_images
from oidv4_toolkit.image_level import image_level

ROOT_DIR = ''
DEFAULT_OID_DIR = os.path.join(ROOT_DIR, 'OID')


def main():

args = parser_arguments()

if args.command == 'downloader_ill':
image_level(args, DEFAULT_OID_DIR)
else:
bounding_boxes_images(args, DEFAULT_OID_DIR)


if __name__ == "__main__":

main()
10 changes: 5 additions & 5 deletions modules/bounding_boxes.py → oidv4_toolkit/bounding_boxes.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import os
from modules.utils import *
from modules.downloader import *
from modules.show import *
from modules.csv_downloader import *
from oidv4_toolkit.utils import *
from oidv4_toolkit.downloader import *
from oidv4_toolkit.show import *
from oidv4_toolkit.csv_downloader import *

from modules.utils import bcolors as bc
from oidv4_toolkit.utils import bcolors as bc

def bounding_boxes_images(args, DEFAULT_OID_DIR):

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import urllib.request
import pandas as pd

from modules.utils import bcolors as bc
from oidv4_toolkit.utils import bcolors as bc

OID_URL = 'https://storage.googleapis.com/openimages/2018_04/'

Expand Down
33 changes: 17 additions & 16 deletions modules/downloader.py → oidv4_toolkit/downloader.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import os
import cv2
from tqdm import tqdm
from modules.utils import images_options
from modules.utils import bcolors as bc
from oidv4_toolkit.utils import images_options
from oidv4_toolkit.utils import bcolors as bc
from multiprocessing.dummy import Pool as ThreadPool


def download(args, df_val, folder, dataset_dir, class_name, class_code, class_list=None, threads = 20):
'''
Manage the download of the images and the label maker.
Expand All @@ -18,19 +19,19 @@ def download(args, df_val, folder, dataset_dir, class_name, class_code, class_li
:param threads: number of threads
:return: None
'''
if os.name == 'posix':
rows, columns = os.popen('stty size', 'r').read().split()
elif os.name == 'nt':
try:
columns, rows = os.get_terminal_size(0)
except OSError:
columns, rows = os.get_terminal_size(1)
else:
columns = 50
l = int((int(columns) - len(class_name))/2)

print ('\n' + bc.HEADER + '-'*l + class_name + '-'*l + bc.ENDC)
print(bc.INFO + 'Downloading {} images.'.format(args.type_csv) + bc.ENDC)
# if os.name == 'posix':
# rows, columns = os.popen('stty size', 'r').read().split()
# elif os.name == 'nt':
# try:
# columns, rows = os.get_terminal_size(0)
# except OSError:
# columns, rows = os.get_terminal_size(1)
# else:
# columns = 50
# l = int((int(columns) - len(class_name))/2)
#
# print ('\n' + bc.HEADER + '-'*l + class_name + '-'*l + bc.ENDC)
# print(bc.INFO + 'Downloading {} images.'.format(args.type_csv) + bc.ENDC)
df_val_images = images_options(df_val, args)

images_list = df_val_images['ImageID'][df_val_images.LabelName == class_code].values
Expand Down Expand Up @@ -74,7 +75,7 @@ def download_img(folder, dataset_dir, class_name, images_list, threads):
commands = []
for image in images_list:
path = image_dir + '/' + str(image) + '.jpg ' + '"' + download_dir + '"'
command = 'aws s3 --no-sign-request --only-show-errors cp s3://open-images-dataset/' + path
command = 'aws s3 --no-sign-request --only-show-errors cp s3://open-images-dataset/' + path
commands.append(command)

list(tqdm(pool.imap(os.system, commands), total = len(commands) ))
Expand Down
Loading