Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mask Generation Tasking (adding about.md) #438

Merged
merged 16 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
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
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll": true
"source.fixAll": "explicit"
bellabf marked this conversation as resolved.
Show resolved Hide resolved
},
"[svelte]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
Expand Down
43 changes: 43 additions & 0 deletions packages/tasks/src/tasks/mask-generation/about.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
## Use Cases

### Filtering an Image

The mask might serve as an initial filter to eliminate irrelevant information. For instance, when monitoring vegetation in satellite imaging, a mask can be created to identify green spots, highlighting the relevant region of the image.
bellabf marked this conversation as resolved.
Show resolved Hide resolved

### Pre-processing

Generating masks that can to separate background and foreground (or other interesting properties) in an image can be done to facilitate learning, especially in semi- or unsupervised learning.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this might actually be used to train segmentation models


### Human-in-the-loop
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you elaborate the use case here? i.e. The name of the use case felt a little ambiguous


For applications where humans are in the loop, masks highlight certain region of images for humans to validate.

## Task Variants

### Binary Masks
bellabf marked this conversation as resolved.
Show resolved Hide resolved

In binary masks, one region is labeled with ones (1) while another region is labeled with zeroes (0).
In this case, matrix multiplication easily retrieves the region of interest.

### Non-Binary Masks

In non-binary masks, the mask contains more than two classes. This is useful when more than one mask is generated for the same image since it makes dealing with the image easier. If there are non-overlapping labeled regions, it is straightforward to recover the mask by selecting which pixels in the image have the corresponding region. If they overlap, a unique way to recover a region might have to be put in place.

### Segmentation Mask
bellabf marked this conversation as resolved.
Show resolved Hide resolved

Segmentation masks are the result of a segmentation algorithm. You can learn more about segmentation on its [task page](https://huggingface.co/tasks/image-segmentation).


### Manually Labeled Mask

Manually Labeled Mask are mask that have been generated, partially or entirely, by human annotations.
bellabf marked this conversation as resolved.
Show resolved Hide resolved

## Inference

This section should have useful information about how to pull a model from Hugging Face Hub which is a part of a library specialized in a task and use it.
bellabf marked this conversation as resolved.
Show resolved Hide resolved

## Useful Resources

Would you like to learn more about mask generation? Great! Here you can find some curated resources that you may find helpful!

- [Simple mask generation using thresholding in Scikit-learn](https://scikit-image.org/docs/stable/auto_examples/segmentation/plot_thresholding.html)
bellabf marked this conversation as resolved.
Show resolved Hide resolved
18 changes: 18 additions & 0 deletions packages/tasks/src/tasks/mask-generation/data.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import type { TaskDataCustom } from "..";
bellabf marked this conversation as resolved.
Show resolved Hide resolved

const taskData: TaskDataCustom = {
datasets: [],
demo: {
inputs: [],
outputs: [],
},
isPlaceholder: true,
metrics: [],
models: [],
spaces: [],
summary: [],
widgetModels: [],
youtubeId: undefined,
};

export default taskData;