You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, this is a first-timers-only issue. This means this has been worked to make it more legible to folks who either haven't contributed to our codebase before, or even folks who haven't contributed to open source before.
If you have contributed before, consider leaving this one for someone new, and looking through our general help wanted issues. Thanks!
The Problem
Image Sequencer processes images sequentially and every algorithm which is responsible for processing the image and generating output is called a step. Some such steps need the user to give an input in order for it to work. For example a Crop module. The user must provide which part of the image has to be cropped (If the user doesn't, the step assumes some default inputs. FOr example, the crop module crops the image to 50% of it's original with and height starting from the top left corner of the image).
We recently added a basic Command Line Interface (CLI) to Image Sequencer, but it isn't complete yet. Currently there is no way for the user to give any input to steps. So all steps requiring inputs, assume the default inputs.
So we need to update the CLI to accept the necessary inputs from the user.
The following line in ./index.js is responsible for adding a step:
sequencer.addSteps(program.step);
The way to pass in options (User Inputs) to a step is by paasing in a JavaScript object to the addSteps() method with input names as the key and inputs as the value.
Naturally, different steps accept different inputs. Every step has a info.json specifying what inputs it accepts and what outputs it gives. These JSON files can be found at ./src/modules/[ModuleName]/info.json.
{
"name": "Crop",
"inputs": {
"x": {
"type": "integer",
"desc": "X-position (measured from left) from where cropping starts",
"default": 0
},
...
}
...
}
You can access the input.json for different modules like this:
// If no step-name is given, an object with info.jsons of all steps is returnedsequencer.modulesInfo('step-name');
The Solution
What you'll have to do is read the inputs for the particular step requested by the user. The requested step is stored in program.step.
Then for every "input" required by the step, take inputs from the user. This could be of the form
$ ./index.js -i [PATH] -s step-name (This is how you run the CLI)
--
[step-name] : Enter a value for $input1 : (Take input)
[step-name] : Enter a value for $input2 : (Take input)
Then, store all this data in a JavaScript Object options and pass it into the method addSteps as shown above.
This is how the options Object should look for the Crop module, for example:
First Timers Only
Hi, this is a first-timers-only issue. This means this has been worked to make it more legible to folks who either haven't contributed to our codebase before, or even folks who haven't contributed to open source before.
If you have contributed before, consider leaving this one for someone new, and looking through our general help wanted issues. Thanks!
The Problem
Image Sequencer processes images sequentially and every algorithm which is responsible for processing the image and generating output is called a step. Some such steps need the user to give an input in order for it to work. For example a
Crop
module. The user must provide which part of the image has to be cropped (If the user doesn't, the step assumes some default inputs. FOr example, the crop module crops the image to 50% of it's original with and height starting from the top left corner of the image).We recently added a basic Command Line Interface (CLI) to Image Sequencer, but it isn't complete yet. Currently there is no way for the user to give any input to steps. So all steps requiring inputs, assume the default inputs.
So we need to update the CLI to accept the necessary inputs from the user.
Towards the solution
The file which handles the CLI is ./index.js.
The following line in ./index.js is responsible for adding a step:
The way to pass in options (User Inputs) to a step is by paasing in a JavaScript object to the
addSteps()
method with input names as the key and inputs as the value.Naturally, different steps accept different inputs. Every step has a
info.json
specifying what inputs it accepts and what outputs it gives. These JSON files can be found at./src/modules/[ModuleName]/info.json
.example : info.json of Crop Module:
You can access the
input.json
for different modules like this:The Solution
What you'll have to do is read the inputs for the particular step requested by the user. The requested step is stored in
program.step
.Then for every "input" required by the step, take inputs from the user. This could be of the form
Then, store all this data in a JavaScript Object
options
and pass it into the methodaddSteps
as shown above.This is how the
options
Object should look for the Crop module, for example:Steps to Fix
work-needed
if you haven't completed the work on the issue)The text was updated successfully, but these errors were encountered: