Multi-task Classification involves training a model to perform multiple classification tasks simultaneously. For example, a model could be trained to classify both the type of person and vehicle attributes in a single image.
Step 0: Preparation
Prepare a attributes file like attributes.json. An example is shown below:
{
"vehicle": {
"bodyColor": [
"red",
"white",
"blue"
],
"vehicleType": [
"SUV",
"sedan",
"bus",
"truck"
]
},
"person": {
"wearsGlasses": ["yes", "no"],
"wearsMask": ["yes", "no"],
"clothingColor": [
"red",
"green",
"blue"
]
}
}
Step 1: Run the Application
python anylabeling/app.py
Step 2: Upload the Configuration File
Click on Upload -> Upload Attributes File
in the top menu bar and select the prepared configuration file to upload.
For detailed output examples, refer to this file.
Similar to Image-Level Classification, you can also conduct multiclass and multilabel classification for Shape-Level Annotation.
Step 0: Preparation
Prepare a flags file like label_flags.yaml. An example is shown below:
person:
- male
- female
helmet:
- white
- red
- blue
- yellow
- green
Step 1: Run the Application
python anylabeling/app.py
Step 2: Upload the Configuration File
Click on Upload -> Upload Label Flags File
in the top menu bar and select the prepared configuration file to upload.
Option 1: Quick Start
python anylabeling/app.py --labels person,helmet --labelflags "{'person': ['male', 'female'], 'helmet': ['white', 'red', 'blue', 'yellow', 'green']}" --validatelabel exact
Tip
The labelflags
key field supports regular expressions. For instance, you can use patterns like {person-\d+: [male, tall], "dog-\d+": [black, brown, white], .*: [occluded]}
.
Option 2: Using a Configuration File
python anylabeling/app.py --labels labels.txt --labelflags label_flags.yaml --validatelabel exact
For detailed output examples, refer to this file.