Upload post-processes
Automate and enhance asset management with custom tasks, triggered on asset upload
Overview
Upload post processes are actions that are triggered for a given asset upon its upload into Filerobot. Post-processing involves running various algorithms and ML models on an asset (e.g., detecting if it contains inappropriate content, counting the number of faces in an image, determining the dominant colors, removing the image background, and many others).
Post process tasks are automated actions that can be performed in two modes:
Synchronous - The results are evaluated before accepting the upload and returned in the response. The use of this mode is generally preferred in user-generated content (UGC) scenarios where user-uploaded images and videos must be moderated automatically based on a number of pre-defined criteria.
Asynchronous - The results are evaluated in the background (in a non-blocking manner) after the file has been uploaded. In some cases, depending on the specified post process type, the result will be appended to the asset's information, tags or metadata.
Post process tasks
The following table is a summary of all available post process actions:
Image assets
Process | API name | Supported modes | Description |
---|---|---|---|
Calculate blurhash |
| async | Generates a blurhash (compact representation that can be used as a placeholder) of the image. The result is added to the asset's information. |
Count faces |
| sync / async | Returns the number of face(s) detected in the image. Can be used for classification or to ensure the presence / absence of face(s) upon upload. |
Extract brand logo * |
| sync / async | Detects the presence of logos from a database containing thousand of popular brands. The list of recognized brands is included in the file information. |
Extract dominant colors |
| sync / async | Analyzes the image and returns a palette consisting of the most prominent colors in the image. |
Index for face clustering * |
| async | Adds the image to an index for face clustering. |
Index for image similarity search |
| async | Adds the image to an index for similarity search. |
Not Safe For Work * |
| sync / async | Detects adult or explicit content within the image. |
Plate number blurring * |
| async | Finds and automatically blurs vehicle license plate numbers in the image. |
Recognize number plate * |
| sync / async | Detects and recognizes car license plates in the image. The result is included in the asset information. |
Recognize text (OCR) * |
| sync / async | Extracts any text readable in the image. |
Remove artifacts (Quality improvement) * |
| async | Removes any JPEG artifacts and improves the quality of the image. |
Remove background * |
| sync / async | Removes the background of the image. Useful for products, portraits, etc. |
Scene classification * |
| sync / async | Detects scene categories, attributes and type of environment in the image. |
Sport classification * |
| async | Detect if the provided image depicts a sport activity and add its name to metadata. |
Tag with AI * |
| async | Performs automatic tag generation for the image. |
Validate image properties |
| sync | Validates if the image meets any number of predefined criteria. |
Video assets
Process | API name | Supported modes | Description |
---|---|---|---|
Compress video * |
| async | Changes the video bitrate and resolution. |
Convert video * |
| async | Converts the video file to another format. |
Transcode video * |
| sync | Converts the video into adaptive streaming formats (HLS/DASH). |
Trim video * |
| async | Trims the video file based on provided time intervals. |
Validate video properties |
| sync | Validates if the video meets any number of predefined criteria. |
Post processes marked with a * require ASK Filerobot credits in order to be executed
Additional details are available on the tasks' respective pages in the Scaleflex Visual AI section
Post process settings
The post process settings can be accessed from the Developers / Automations / Post processing menu.
When a post process automation task is activated, it will run automatically on each upload. If not activated, the task can be manually triggered for certain uploads via the Upload API using the postprocess parameter (e.g., postprocess=remove-background
).
Trigger rules
It is possible to specify trigger rules when setting up a post process. These are conditions which must be met in order to activate the related task. If left empty, the task will be run on each upload.
Trigger rules are evaluated no matter if the task is run manually or automatically.
The following variables may be used to construct rules:
Property | Asset type | Description | Example |
---|---|---|---|
Image/Video width (px) | images / videos | Horizontal image dimensions / frame size (in pixels). |
|
Image/Video height (px) | images / videos | Vertical image dimensions / frame size (in pixels). |
|
Image format | images | The file type of the image. |
|
File size (B) | images / videos | The size of the asset in bytes. |
|
Video bitrate (bps) | videos | The video bitrate in bits per second. |
|
Video duration (s) | videos | The video duration in seconds. |
|
Upload folder path | images / videos | The location in which the asset is getting uploaded. |
|
Validation rules
As mentioned, the synchronous tasks provide a mechanism to validate uploads using validation rules. Possible actions when conditions have been met are:
Refuse - The upload is rejected.
Notice - A notice is issued, added to the file information and returned in the API response.
Setting up many synchronous tasks might slow down the upload process significantly.
Process | Validation rule | Example |
---|---|---|
Count faces |
|
|
Not Safe For Work |
|
|
Recognize number plate |
|
|
Recognize text (OCR) |
|
|
Validate image properties |
|
|
Validate video properties |
|
|
Last updated