Skip to content

Latest commit

 

History

History
341 lines (270 loc) · 12.3 KB

EdgeApplicationSDK_FuncSpec_ImageDownload.adoc

File metadata and controls

341 lines (270 loc) · 12.3 KB

Edge Application SDK
Image Download
Functional Specifications

1. Change history

Date What/Why

2022/12/12

Initial draft.

2023/01/30

Directory structure change.
Added that symbolic links must not be used.
Following the deletion of the secret information, Initial was removed from the configuration file entry and added about creating a configuration file.
Updated the PDF build environment.

2023/05/26

Fixed the notation of tool names and parentheses.
Some environments do not render AsciiDoc’s Mermaid diagrams, so modified to rendered image references.
Added alternate text to images.

2. Terms/Abbreviations

Terms/Abbreviations Meaning

COCO

Common Objects in Context
Large-scale object detection, segmentation, caption dataset

3. Reference materials

4. Expected use case

  • Download sample images from COCO for importing and annotating in "Console for AITRIOS"

5. Functional overview/Algorithm

Functional overview

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
Loading
  • 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)))
Loading
  • Flow details

    1. Setup for running the notebook

    2. Create and edit the configuration file for running the notebook

      • Create and edit the configuration file, configuration.json, to configure notebook runtime settings

    3. Run the notebook

      • Run the notebook to download sample images from COCO

6. User interface specifications

How to start each function

  1. Launch the SDK environment and preview the README.md in the top directory

  2. Jump to the README.md in the tutorials directory from the hyperlink in the SDK environment top directory

  3. Jump to the 2_prepare_dataset directory from the hyperlink in the README.md in the tutorials directory

  4. Jump to the download_images directory from the hyperlink in the README.md in the 2_prepare_dataset directory

  5. Jump to each feature from each file in the download_images directory

Setup for running the notebook

  1. Download COCO annotations file in your browser from the procedure and link provided in README.md in the download_images directory

  2. 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
Loading

Create and edit the configuration file for running the notebook

  1. Create and edit the configuration file, configuration.json, in the download_images directory

Note
Do not use symbolic links to files and directories.
Configuration Meaning Range Remarks

annotation_file

COCO annotations file path

Absolute path or relative to the configuration.json/Notebook (*.ipynb)

  • Don’t abbreviate

category_names

Image category names

Downloads only images matching this category

["Category1", "Category2", ・・・]

See category_names list for categories

  • Optional

  • If omitted or no category is specified (an empty list is specified), all categories will be downloaded

max_download_count

Maximum number of images downloaded per category

Downloads the following number of images per category
0: Downloads all images
1: Downloads a single image
2: Downloads two images
・・・
All images: Downloads all images
All images+1: Downloads all images

  • Optional

  • If omitted or 0 is specified, all images matching the conditions will be downloaded

  • If category_names is omitted or category is not specified (an empty list is specified), this parameter is the total number of downloads, not the number of downloads per category

licenses

Image license

Downloads only images applicable to this license

[License1 ID, License2 ID, ・・・]

See license list for license

  • Optional

  • If omitted or no license is specified (an empty list is specified), all licenses are applicable for download

remove_categories

Category names to exclude

Images matching this category will not be downloaded

["Category1", "Category2", ・・・]

See category_names list for categories

  • Optional

  • If omitted or no category is specified (an empty list is specified), no exclusion will occur

output_dir

Directory to store download images

Absolute path or relative to the configuration.json/Notebook (*.ipynb)

  • Don’t abbreviate

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
(CC BY-NC-SA 2.0)

No

Yes

1

Attribution-NonCommercial License
(CC BY-NC 2.0)

No

Yes

2

Attribution-NonCommercial-NoDerivs License
(CC BY-NC-ND 2.0)

No

Yes

3

Attribution License
(CC BY 2.0)

Yes

Yes

4

Attribution-ShareAlike License
(CC BY-SA 2.0)

Yes

Yes

5

Attribution-NoDerivs License
(CC BY-ND 2.0)

Yes

Yes

6

No known copyright restrictions

See NOTE

See NOTE

7

United States Government Work

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:

  • The copyright is in the public domain because it has expired

  • The copyright was put into the public domain for other reasons, such as failure to comply with necessary procedures and conditions

  • The institution owns the copyright but is not interested in exercising control or has sufficient legal rights to allow others to use the work without restriction

Run the notebook

  1. 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

7. Target performances/Impact on performances

  • None

8. Assumption/Restriction

  • None

9. Remarks

  • None

10. Unconfirmed items

  • None