Automate and enhance asset management with custom tasks, triggered on asset upload
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.
The following table is a summary of all available post process actions:
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
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
).
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:
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 | API name | Supported modes | Description |
---|---|---|---|
Process | API name | Supported modes | Description |
---|---|---|---|
Property | Asset type | Description | Example |
---|---|---|---|
Process | Validation rule | Example |
---|---|---|
Calculate blurhash
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
face-count
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 *
brand-detect
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
dominant-color
sync / async
Analyzes the image and returns a palette consisting of the most prominent colors in the image.
Index for face clustering *
face-clustering
async
Adds the image to an index for face clustering.
Index for image similarity search
image-similarities
async
Adds the image to an index for similarity search.
Not Safe For Work *
nsfw
sync / async
Detects adult or explicit content within the image.
Plate number blurring *
plate-blurring
async
Finds and automatically blurs vehicle license plate numbers in the image.
Recognize number plate *
plate-recognition
sync / async
Detects and recognizes car license plates in the image. The result is included in the asset information.
Recognize text (OCR) *
ocr
sync / async
Extracts any text readable in the image.
Remove artifacts (Quality improvement) *
remove-artifacts
async
Removes any JPEG artifacts and improves the quality of the image.
Remove background *
remove-background
sync / async
Removes the background of the image. Useful for products, portraits, etc.
Scene classification *
scene-classification
sync / async
Detects scene categories, attributes and type of environment in the image.
Sport classification *
sport-classification
async
Detect if the provided image depicts a sport activity and add its name to metadata.
Tag with AI *
autotag
async
Performs automatic tag generation for the image.
Validate image properties
image-properties
sync
Validates if the image meets any number of predefined criteria.
Compress video *
compress
async
Changes the video bitrate and resolution.
Convert video *
convert
async
Converts the video file to another format.
Transcode video *
transcode
sync
Converts the video into adaptive streaming formats (HLS/DASH).
Trim video *
trim
async
Trims the video file based on provided time intervals.
Validate video properties
video-properties
sync
Validates if the video meets any number of predefined criteria.
Image/Video width (px)
images / videos
Horizontal image dimensions / frame size (in pixels).
Image width (px) is smaller than 500
Image/Video height (px)
images / videos
Vertical image dimensions / frame size (in pixels).
Video height (px) is larger or equal than 200
Image format
images
The file type of the image.
Image format contains PNG, JPEG
File size (B)
images / videos
The size of the asset in bytes.
File size (B) is larger than 5000000
Video bitrate (bps)
videos
The video bitrate in bits per second.
Video bitrate (bps) is smaller than 1500000
Video duration (s)
videos
The video duration in seconds.
Video duration (s) is larger than 60
Upload folder path
images / videos
The location in which the asset is getting uploaded.
Upload folder path starts with '/users'
Count faces
Number of faces
Number of faces is smaller than 1 => Refuse
Not Safe For Work
NSFW
Drawing
Hentai
Neutral
Porn
NSFW is larger than 0.70 => Refuse
Recognize number plate
Number of characters in number plate
Number plate content
Number plate content does not start with 'C' => Notice
Recognize text (OCR)
Text contains
Text contains 'Copyright' => Refuse
Validate image properties
Image/Video width (px)
Image/Video height (px)
Image format
File size (B)
Upload folder path
Image width (px) is smaller than 500 => Notice
Validate video properties
Image/Video width (px)
Image/Video height (px)
File size (B)
Video bitrate (bps)
Video duration (s)
Upload folder path
Video bitrate (bps) is smaller than 800000 => Refuse