Date | What/Why |
---|---|
2022/12/12 |
Initial draft. |
2023/01/30 |
Directory structure change. |
2023/05/26 |
Fixed the notation of tool names and parentheses. |
Terms/Abbreviations | Meaning |
---|---|
COCO |
Common Objects in Context |
-
Reference/Related documents
-
COCO Download
-
COCO annotations file
-
-
Download sample images from COCO for importing and annotating in "Console for AITRIOS"
The SDK downloads sample images from COCO in the following flow
flowchart TD;
%% definition
classDef object fill:#FFE699, stroke:#FFD700
style legend fill:#FFFFFF, stroke:#000000
%% impl
subgraph legend["Legend"]
process(Processing/User behavior)
end
-
Flow overview
flowchart TD
start((Start)) --> id1(1.Setup for running the notebook)
id1 --> id2(2.Create and edit the configuration file for running the notebook)
id2 --> id3(3.Run the notebook)
id3 --> finish(((Finish)))
-
Flow details
-
Setup for running the notebook
-
Create and edit the configuration file for running the notebook
-
Create and edit the configuration file,
configuration.json
, to configure notebook runtime settings
-
-
Run the notebook
-
Run the notebook to download sample images from COCO
-
-
-
Launch the SDK environment and preview the
README.md
in the top directory -
Jump to the
README.md
in thetutorials
directory from the hyperlink in the SDK environment top directory -
Jump to the
2_prepare_dataset
directory from the hyperlink in theREADME.md
in thetutorials
directory -
Jump to the
download_images
directory from the hyperlink in theREADME.md
in the2_prepare_dataset
directory -
Jump to each feature from each file in the
download_images
directory
-
Download COCO annotations file in your browser from the procedure and link provided in
README.md
in thedownload_images
directory -
Extract the downloaded COCO annotations file zip to the path specified in the configuration file
%%{init:{'themeVariables':{'fontSize':'24px'}, 'themeCSS':'text.actor {font-size:18px !important;} .messageText {font-size:18px !important;}'}}%%
sequenceDiagram
Title Setup for running the notebook
participant user as User
participant readme as README.md<br/>in the<br/>download_images<br/>directory
participant browser as Browser
participant coco as COCO website
user->>readme: Click link
readme->>browser: Request download
browser->>coco: Request download
coco-->>browser: COCO annotations<br>file zip
browser-->>user: COCO annotations<br>file zip
user-->>user: Extract <br>COCO annotations<br>file zip
-
Create and edit the configuration file,
configuration.json
, in thedownload_images
directory
Note
|
Do not use symbolic links to files and directories. |
Configuration | Meaning | Range | Remarks |
---|---|---|---|
|
COCO annotations file path |
Absolute path or relative to the |
|
|
Image category names |
["Category1", "Category2", ・・・] |
|
|
Maximum number of images downloaded per category |
Downloads the following number of images per category |
|
|
Image license |
[License1 ID, License2 ID, ・・・] |
|
|
Category names to exclude |
["Category1", "Category2", ・・・] See category_names list for categories |
|
|
Directory to store download images |
Absolute path or relative to the |
|
category_names
list
type: | Person | Veicle | Outdoor | Animal | Accessory | Sports | Kitcen | Food | Furniture | Electronic | Appliance | Indoor |
---|---|---|---|---|---|---|---|---|---|---|---|---|
category name |
person |
bicycle |
traffic light |
bird |
backpack |
frisbee |
bottle |
banana |
chair |
tv |
microwave |
book |
car |
fire hydrant |
cat |
umbrella |
skis |
wine glass |
apple |
couch |
laptop |
oven |
clock |
||
motorcycle |
stop sign |
dog |
handbag |
snowboard |
cup |
sandwich |
potted plant |
mouse |
toaster |
vase |
||
airplane |
parking meter |
horse |
tie |
sports ball |
fork |
orange |
bed |
remote |
sink |
scissors |
||
bus |
bench |
sheep |
suitcase |
kite |
knife |
broccoli |
dining table |
keyboard |
refrigerator |
teddy bear |
||
train |
cow |
baseball bat |
spoon |
carrot |
toilet |
cell phone |
hair drier |
|||||
truck |
elephant |
baseball glove |
bowl |
hot dog |
toothbrush |
|||||||
boat |
bear |
skateboard |
pizza |
|||||||||
zebra |
surfboard |
donut |
||||||||||
giraffe |
tennis racket |
cake |
license
list
License | Commercial use | Redistribution | ID |
---|---|---|---|
Attribution-NonCommercial-ShareAlike License |
No |
Yes |
1 |
Attribution-NonCommercial License |
No |
Yes |
2 |
Attribution-NonCommercial-NoDerivs License |
No |
Yes |
3 |
Attribution License |
Yes |
Yes |
4 |
Attribution-ShareAlike License |
Yes |
Yes |
5 |
Attribution-NoDerivs License |
Yes |
Yes |
6 |
See NOTE |
See NOTE |
7 |
|
Yes (with exceptions) |
Yes (with exceptions) |
8 |
Note
|
No known copyright restrictions
This means that the copyright of each work is not cleared. For details, you have to check the Rights Statement of each participating institution. There are various cases as follows:
|
-
Open the notebook, *.ipynb, in the
download_images
directory, and run the python scripts in it-
The scripts do the following:
-
Checks that configuration.json exists in the
download_images
directory-
If an error occurs, the error description is displayed and running is interrupted.
-
-
Checks the contents of configuration.json
-
If an error occurs, the error description is displayed and running is interrupted.
-
-
Checks that COCO annotations file exists in the directory specified in configuration.json for
annotation_file
-
If an error occurs, the error description is displayed and running is interrupted.
-
-
Reads the COCO annotations file from the directory specified in configuration.json for
annotation_file
makes the necessary settings in Pycocotools: -
If an error occurs in external software, for example, Pycocotools, the error output by the external software is displayed and running is interrupted
-
Downloads images determined from following
-
Images matching the category specified in configuration.json for
category_names
-
if only values not present in the category_names list are set to the
category_names
, error description is displayed and running is interrupted -
If both present and not present values in the category_names list are set to the
category_names
, warns about values not present in the list and continues using only values present
-
-
Number of images downloaded specified in configuration.json for
max_download_count
-
If negative value is set to the
max_download_count
error description is displayed and running is interrupted
-
-
Images applicable to the license specified in configuration.json for
licenses
-
if only values not present in the license list are set to the
licenses
, error description is displayed and running is interrupted -
If both present and not present values in the license list are set to the
licenses
, warns about values not present in the list and continues using only values present
-
-
Excludes images matching the category specified in configuration.json for
remove_categories
-
if only values not present in the category_names list are set to the
remove_categories
, error description is displayed and running is interrupted -
If both present and not present values in the category_names list are set to the
remove_categories
list, warns about values not present in the list and continues using only values present
-
-
If the number of images matching the preceding conditions reaches zero, a warning is displayed
-
-
Outputs the downloaded images to the directory specified in configuration.json for
output_dir
. if the directory does not already exist, it is created at the same time -
Displays the following while downloading:
downloading id: 416256 downloaded 1/30 images (t=1.0s) downloading id: 269314 downloaded 2/30 images (t=1.0s) downloading id: 17029 downloaded 3/30 images (t=1.4s) ... downloading id: 117374 downloaded 30/30 images (t=1.3s)
-
While downloading, you can interrupt with the Stop Cell Execution of notebook cell function
-
-