-
Notifications
You must be signed in to change notification settings - Fork 229
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds a refinement task to label the images in categories;
- Loading branch information
1 parent
69db9bf
commit d9020ca
Showing
6 changed files
with
80 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* Script of Category Specialization based on item properties. | ||
* Uses javascript language to allow flexibility in definitions. | ||
*/ | ||
|
||
/* Name of processing task | ||
*/ | ||
|
||
var categorizationThreshold=0.5; | ||
var RemoteImageClassifierConfig=Java.type("iped.engine.config.RemoteImageClassifierConfig") | ||
var Arrays=Java.type("java.util.Arrays") | ||
|
||
function getName(){ | ||
return "AIRefineCategoryTask"; | ||
} | ||
|
||
|
||
function getConfigurables() { | ||
|
||
return Arrays.asList(new RemoteImageClassifierConfig()); | ||
} | ||
|
||
function init(configurationManager) { | ||
config=configurationManager.findObject(RemoteImageClassifierConfig.class) | ||
categorizationThreshold=config.getCategorizationThreshold() | ||
} | ||
|
||
function finish(){} | ||
|
||
/* | ||
* Changes category of items based on their properties | ||
* | ||
*/ | ||
function process(e){ | ||
|
||
listcategories={ | ||
"ASI":"AI Label: Child Sexual Abuse", | ||
"ASI_SUSP":"AI Label: Likely Child Sexual Abuse", | ||
"Desenhos":"AI Label: Drawing", | ||
"Outros":"AI Label: Other", | ||
"Pessoas":"AI Label: People", | ||
"Porn":"AI Label: Pornography", | ||
} | ||
for(cat in listcategories){ | ||
if (e.getExtraAttribute(cat)>0.5){ | ||
e.addCategory(listcategories[cat]); | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters