Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
5 changes: 5 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extends": [
"config:base"
]
}
74 changes: 45 additions & 29 deletions src/Contracts/MediaRecognition.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,76 +7,82 @@ interface MediaRecognition
/**
* Sets the source/path where the file is stored.
*
* @param string $source
* @param string|null $mimeType
* @param int|null $mediaId
* @param string $source
* @param string|null $mimeType
* @param int|null $mediaId
* @return $this
*/
public function source(string $source, string $mimeType = null, int $mediaId = null);

/**
* Sets the source/path where the file is stored.
*
* @param string $path
* @param string|null $mimeType
* @param int|null $mediaId
* @param string $path
* @param string|null $mimeType
* @param int|null $mediaId
* @return $this
*/
public function path(string $path, string $mimeType = null, int $mediaId = null);

/**
* Detects labels/objects in an image or video.
*
* @param int|null $minConfidence
* @param int|null $maxLabels
* @param int|null $minConfidence
* @param int|null $maxLabels
* @return mixed
*
* @throws \Exception
*/
public function detectLabels($minConfidence = null, $maxLabels = null);

/**
* Detects labels/objects in an image.
*
* @param int|null $minConfidence
* @param int|null $maxLabels
* @param int|null $minConfidence
* @param int|null $maxLabels
* @return mixed
*
* @throws \Exception
*/
public function detectImageLabels($minConfidence = null, $maxLabels = null);

/**
* Detects labels/objects in a video.
*
* @param int|null $minConfidence
* @param int|null $maxLabels
* @param int|null $minConfidence
* @param int|null $maxLabels
* @return mixed
*
* @throws \Exception
*/
public function detectVideoLabels($minConfidence = null, $maxLabels = null);

/**
* Detects faces in an image or video & analyzes them.
*
* @param array $attributes
* @param array $attributes
* @return mixed
*
* @throws \Exception
*/
public function detectFaces($attributes = ['DEFAULT']);

/**
* Detects faces in an image & analyzes them.
*
* @param array $attributes
* @param array $attributes
* @return mixed
*
* @throws \Exception
*/
public function detectImageFaces($attributes = ['DEFAULT']);

/**
* Detects faces in an image & analyzes them.
*
* @param array $attributes
* @param array $attributes
* @return mixed
*
* @throws \Exception
*/
public function detectVideoFaces($attributes = ['DEFAULT']);
Expand All @@ -85,8 +91,9 @@ public function detectVideoFaces($attributes = ['DEFAULT']);
* Detects moderation labels in an image or video.
* This can be useful for children-friendly images or NSFW images/videos.
*
* @param int|null $minConfidence
* @param int|null $minConfidence
* @return mixed
*
* @throws \Exception
*/
public function detectModeration($minConfidence = null);
Expand All @@ -95,8 +102,9 @@ public function detectModeration($minConfidence = null);
* Detects moderation labels in an image.
* This can be useful for children-friendly images or NSFW images.
*
* @param int|null $minConfidence
* @param int|null $minConfidence
* @return mixed
*
* @throws \Exception
*/
public function detectImageModeration($minConfidence = null);
Expand All @@ -105,75 +113,83 @@ public function detectImageModeration($minConfidence = null);
* Detects moderation labels in an video.
* This can be useful for children-friendly videos or NSFW videos.
*
* @param int|null $minConfidence
* @param int|null $minConfidence
* @return mixed
*
* @throws \Exception
*/
public function detectVideoModeration($minConfidence = null);

/**
* Detects text in an image or video (OCR).
*
* @param array|null $filters
* @param array|null $filters
* @return mixed
*
* @throws \Exception
*/
public function detectText(array $filters = null);

/**
* Detects text in an image (OCR).
*
* @param array|null $filters
* @param array|null $filters
* @return mixed
*
* @throws \Exception
*/
public function detectImageText(array $filters = null);

/**
* Detects text in a video (OCR).
*
* @param array|null $filters
* @param array|null $filters
* @return mixed
*
* @throws \Exception
*/
public function detectVideoText(array $filters = null);

/**
* Get the "faces" from the video analysis.
*
* @param string $jobId
* @param int $mediaId
* @param string $jobId
* @param int $mediaId
* @return \Aws\Result
*
* @throws \Exception
*/
public function getFacesByJobId(string $jobId, int $mediaId);

/**
* Get the labels from the video analysis.
*
* @param string $jobId
* @param int $mediaId
* @param string $jobId
* @param int $mediaId
* @return \Aws\Result
*
* @throws \Exception
*/
public function getLabelsByJobId(string $jobId, int $mediaId);

/**
* Get the "content moderation" from the video analysis.
*
* @param string $jobId
* @param int $mediaId
* @param string $jobId
* @param int $mediaId
* @return \Aws\Result
*
* @throws \Exception
*/
public function getContentModerationByJobId(string $jobId, int $mediaId);

/**
* Get the "text detection" from the video analysis.
*
* @param string $jobId
* @param int $mediaId
* @param string $jobId
* @param int $mediaId
* @return \Aws\Result
*
* @throws \Exception
*/
public function getTextDetectionByJobId(string $jobId, int $mediaId);
Expand Down
2 changes: 1 addition & 1 deletion src/Events/FacialAnalysisCompleted.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class FacialAnalysisCompleted
* Create a new event instance.
*
* @param $message
* @param int|null $mediaId
* @param int|null $mediaId
*/
public function __construct($message, int $mediaId = null)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Events/LabelAnalysisCompleted.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class LabelAnalysisCompleted
* Create a new event instance.
*
* @param $message
* @param int|null $mediaId
* @param int|null $mediaId
*/
public function __construct($message, int $mediaId = null)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Events/ModerationAnalysisCompleted.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class ModerationAnalysisCompleted
* Create a new event instance.
*
* @param $message
* @param int|null $mediaId
* @param int|null $mediaId
*/
public function __construct($message, int $mediaId = null)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Events/TextAnalysisCompleted.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class TextAnalysisCompleted
* Create a new event instance.
*
* @param $message
* @param int|null $mediaId
* @param int|null $mediaId
*/
public function __construct($message, int $mediaId = null)
{
Expand Down
7 changes: 4 additions & 3 deletions src/Http/Controllers/IncomingWebhookController.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,10 @@ public function __invoke()
}

/**
* @param string $type
* @param array $message
* @param int|null $mediaId
* @param string $type
* @param array $message
* @param int|null $mediaId
*
* @throws \Exception
*/
public function fireEventFor(string $type, array $message, int $mediaId = null)
Expand Down
4 changes: 2 additions & 2 deletions src/Http/Middleware/VerifySignature.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ class VerifySignature
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
Expand Down
9 changes: 5 additions & 4 deletions src/Jobs/StartFaceDetection.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ class StartFaceDetection implements ShouldQueue
/**
* Create a new job instance.
*
* @param string $path
* @param string|null $mimeType
* @param int|null $mediaId
* @param string $faceAttribute
* @param string $path
* @param string|null $mimeType
* @param int|null $mediaId
* @param string $faceAttribute
*/
public function __construct(string $path, $mimeType = null, $mediaId = null, $faceAttribute = 'DEFAULT')
{
Expand All @@ -51,6 +51,7 @@ public function __construct(string $path, $mimeType = null, $mediaId = null, $fa
* Execute the job.
*
* @return void
*
* @throws \Exception
*/
public function handle()
Expand Down
11 changes: 6 additions & 5 deletions src/Jobs/StartLabelDetection.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ class StartLabelDetection implements ShouldQueue
/**
* Create a new job instance.
*
* @param string $path
* @param string|null $mimeType
* @param int|null $mediaId
* @param int|null $minConfidence
* @param int $maxResults
* @param string $path
* @param string|null $mimeType
* @param int|null $mediaId
* @param int|null $minConfidence
* @param int $maxResults
*/
public function __construct(string $path, $mimeType = null, $mediaId = null, $minConfidence = null, $maxResults = 1000)
{
Expand All @@ -55,6 +55,7 @@ public function __construct(string $path, $mimeType = null, $mediaId = null, $mi
* Execute the job.
*
* @return void
*
* @throws \Exception
*/
public function handle()
Expand Down
9 changes: 5 additions & 4 deletions src/Jobs/StartModerationDetection.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ class StartModerationDetection implements ShouldQueue
/**
* Create a new job instance.
*
* @param string $path
* @param string|null $mimeType
* @param int|null $mediaId
* @param int|null $minConfidence
* @param string $path
* @param string|null $mimeType
* @param int|null $mediaId
* @param int|null $minConfidence
*/
public function __construct(string $path, $mimeType = null, $mediaId = null, $minConfidence = null)
{
Expand All @@ -51,6 +51,7 @@ public function __construct(string $path, $mimeType = null, $mediaId = null, $mi
* Execute the job.
*
* @return void
*
* @throws \Exception
*/
public function handle()
Expand Down
9 changes: 5 additions & 4 deletions src/Jobs/StartTextDetection.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ class StartTextDetection implements ShouldQueue
/**
* Create a new job instance.
*
* @param string $path
* @param string|null $mimeType
* @param int|null $mediaId
* @param array $filters
* @param string $path
* @param string|null $mimeType
* @param int|null $mediaId
* @param array $filters
*/
public function __construct(string $path, $mimeType = null, $mediaId = null, $filters = [])
{
Expand All @@ -51,6 +51,7 @@ public function __construct(string $path, $mimeType = null, $mediaId = null, $fi
* Execute the job.
*
* @return void
*
* @throws \Exception
*/
public function handle()
Expand Down
Loading