- App usage guide - go to the app repository
- Simplified architecture
- Setup the API
- Running the API
- Downloading images
- Setup and run app - go to the app repository
This is the API side of a project created to facilitate the data acquisition and the data labelling steps for supervised computer vision tasks.
You just need to create an image Domain (e.g. animals) and its Classes (e.g. Dog, Cat and Duck) to start the labeling.
- Setup ruby - version 2.7.0
- Install rails 5.2.4 with
gem install rails -v 5.2.4
- Run
bundle install
to install the project dependencies - Run
rails db:create
to create the database andrails db:migrate
to run the database migrations
- Run the project with
rails server -b 0.0.0.0
to let the API visible in your intranet - If everything goes well, your API is running on
http://<your IP Address>:3000
- Now, you just need to get your API address to setup the App side, following the instructions on the App Repository.
- To download the labeled images, you just need to:
- Run the API server
- In another terminal instance, run
ruby download.rb -<args>
with the intended arguments, decribed as follows:
Usage: download_images [options]
-d, --domain [ARG] Specify the domain id to download its images
-f, --folder [ARG] Root folder to save the downloaded images
-l, --list_domains To list every possible domain with its id
-h, --help To get the available arguments
- Example 1: List all created domains and its id:
- Run:
ruby download.rb -l
. The output should be something like:
- Run:
1 - animals
- Example 2: download the animals (id 1) domain images into a default folder
'./downloads/domains/1-animals'
.- Run:
ruby download.rb -d 1
. The output should be something like:
- Run:
Input data:
|--- Domain ID: 1
|--- Domain Folder Name:
Procced with the request? (y/N)
y
|--- Domain Name: animals
Procced with the request? (y/N)
y
Start download for class: cat
Finished download for class: cat
-------
Start download for class: dog
Finished download for class: dog
-------
End of execution...
- Example 3: download the animals (id 1) domain images into a custom folder named 'classifications' (note: the path will be
'./downloads/domains/classifications'
).- Run:
ruby download.rb -d 1 -f classifications
. The output should be something like:
- Run:
Input data:
|--- Domain ID: 1
|--- Domain Folder Name: classifications
Procced with the request? (y/N)
y
|--- Domain Name: animals
Procced with the request? (y/N)
y
Start download for class: cat
Finished download for class: cat
-------
Start download for class: dog
Finished download for class: dog
-------
End of execution...