also looking at this
meemalabs/laravel-media-recognition
Configure Renovate
#20
19 files
+148
-99
formatting only · 12 hidden lines
| @@ -7,9 +7,9 @@ interface MediaRecognition formatting only | ||
| 7 | 7 | /** |
| 8 | 8 | * Sets the source/path where the file is stored. |
| 9 | 9 | * |
| 10 | * @param string $source | |
| 11 | * @param string|null $mimeType | |
| 12 | * @param int|null $mediaId | |
| 10 | * @param string $source | |
| 11 | * @param string|null $mimeType | |
| 12 | * @param int|null $mediaId | |
| 13 | 13 | * @return $this |
| 14 | 14 | */ |
| 15 | 15 | public function source(string $source, string $mimeType = null, int $mediaId = null); |
formatting only · 12 hidden lines
| @@ -17,9 +17,9 @@ interface MediaRecognition formatting only | ||
| 17 | 17 | /** |
| 18 | 18 | * Sets the source/path where the file is stored. |
| 19 | 19 | * |
| 20 | * @param string $path | |
| 21 | * @param string|null $mimeType | |
| 22 | * @param int|null $mediaId | |
| 20 | * @param string $path | |
| 21 | * @param string|null $mimeType | |
| 22 | * @param int|null $mediaId | |
| 23 | 23 | * @return $this |
| 24 | 24 | */ |
| 25 | 25 | public function path(string $path, string $mimeType = null, int $mediaId = null); |
| @@ -27,9 +27,10 @@ interface MediaRecognition | ||
| 27 | 27 | /** |
| 28 | 28 | * Detects labels/objects in an image or video. |
| 29 | 29 | * |
| 30 | * @param int|null $minConfidence | |
| 31 | * @param int|null $maxLabels | |
| 30 | * @param int|null $minConfidence | |
| 31 | * @param int|null $maxLabels | |
| 32 | 32 | * @return mixed |
| 33 | * | |
| 33 | 34 | * @throws \Exception |
| 34 | 35 | */ |
| 35 | 36 | public function detectLabels($minConfidence = null, $maxLabels = null); |
| @@ -37,9 +38,10 @@ interface MediaRecognition | ||
| 37 | 38 | /** |
| 38 | 39 | * Detects labels/objects in an image. |
| 39 | 40 | * |
| 40 | * @param int|null $minConfidence | |
| 41 | * @param int|null $maxLabels | |
| 41 | * @param int|null $minConfidence | |
| 42 | * @param int|null $maxLabels | |
| 42 | 43 | * @return mixed |
| 44 | * | |
| 43 | 45 | * @throws \Exception |
| 44 | 46 | */ |
| 45 | 47 | public function detectImageLabels($minConfidence = null, $maxLabels = null); |
| @@ -47,9 +49,10 @@ interface MediaRecognition | ||
| 47 | 49 | /** |
| 48 | 50 | * Detects labels/objects in a video. |
| 49 | 51 | * |
| 50 | * @param int|null $minConfidence | |
| 51 | * @param int|null $maxLabels | |
| 52 | * @param int|null $minConfidence | |
| 53 | * @param int|null $maxLabels | |
| 52 | 54 | * @return mixed |
| 55 | * | |
| 53 | 56 | * @throws \Exception |
| 54 | 57 | */ |
| 55 | 58 | public function detectVideoLabels($minConfidence = null, $maxLabels = null); |
| @@ -57,8 +60,9 @@ interface MediaRecognition | ||
| 57 | 60 | /** |
| 58 | 61 | * Detects faces in an image or video & analyzes them. |
| 59 | 62 | * |
| 60 | * @param array $attributes | |
| 63 | * @param array $attributes | |
| 61 | 64 | * @return mixed |
| 65 | * | |
| 62 | 66 | * @throws \Exception |
| 63 | 67 | */ |
| 64 | 68 | public function detectFaces($attributes = ['DEFAULT']); |
| @@ -66,8 +70,9 @@ interface MediaRecognition | ||
| 66 | 70 | /** |
| 67 | 71 | * Detects faces in an image & analyzes them. |
| 68 | 72 | * |
| 69 | * @param array $attributes | |
| 73 | * @param array $attributes | |
| 70 | 74 | * @return mixed |
| 75 | * | |
| 71 | 76 | * @throws \Exception |
| 72 | 77 | */ |
| 73 | 78 | public function detectImageFaces($attributes = ['DEFAULT']); |
| @@ -75,8 +80,9 @@ interface MediaRecognition | ||
| 75 | 80 | /** |
| 76 | 81 | * Detects faces in an image & analyzes them. |
| 77 | 82 | * |
| 78 | * @param array $attributes | |
| 83 | * @param array $attributes | |
| 79 | 84 | * @return mixed |
| 85 | * | |
| 80 | 86 | * @throws \Exception |
| 81 | 87 | */ |
| 82 | 88 | public function detectVideoFaces($attributes = ['DEFAULT']); |
| @@ -85,8 +91,9 @@ interface MediaRecognition | ||
| 85 | 91 | * Detects moderation labels in an image or video. |
| 86 | 92 | * This can be useful for children-friendly images or NSFW images/videos. |
| 87 | 93 | * |
| 88 | * @param int|null $minConfidence | |
| 94 | * @param int|null $minConfidence | |
| 89 | 95 | * @return mixed |
| 96 | * | |
| 90 | 97 | * @throws \Exception |
| 91 | 98 | */ |
| 92 | 99 | public function detectModeration($minConfidence = null); |
| @@ -95,8 +102,9 @@ interface MediaRecognition | ||
| 95 | 102 | * Detects moderation labels in an image. |
| 96 | 103 | * This can be useful for children-friendly images or NSFW images. |
| 97 | 104 | * |
| 98 | * @param int|null $minConfidence | |
| 105 | * @param int|null $minConfidence | |
| 99 | 106 | * @return mixed |
| 107 | * | |
| 100 | 108 | * @throws \Exception |
| 101 | 109 | */ |
| 102 | 110 | public function detectImageModeration($minConfidence = null); |
| @@ -105,8 +113,9 @@ interface MediaRecognition | ||
| 105 | 113 | * Detects moderation labels in an video. |
| 106 | 114 | * This can be useful for children-friendly videos or NSFW videos. |
| 107 | 115 | * |
| 108 | * @param int|null $minConfidence | |
| 116 | * @param int|null $minConfidence | |
| 109 | 117 | * @return mixed |
| 118 | * | |
| 110 | 119 | * @throws \Exception |
| 111 | 120 | */ |
| 112 | 121 | public function detectVideoModeration($minConfidence = null); |
| @@ -114,8 +123,9 @@ interface MediaRecognition | ||
| 114 | 123 | /** |
| 115 | 124 | * Detects text in an image or video (OCR). |
| 116 | 125 | * |
| 117 | * @param array|null $filters | |
| 126 | * @param array|null $filters | |
| 118 | 127 | * @return mixed |
| 128 | * | |
| 119 | 129 | * @throws \Exception |
| 120 | 130 | */ |
| 121 | 131 | public function detectText(array $filters = null); |
| @@ -123,8 +133,9 @@ interface MediaRecognition | ||
| 123 | 133 | /** |
| 124 | 134 | * Detects text in an image (OCR). |
| 125 | 135 | * |
| 126 | * @param array|null $filters | |
| 136 | * @param array|null $filters | |
| 127 | 137 | * @return mixed |
| 138 | * | |
| 128 | 139 | * @throws \Exception |
| 129 | 140 | */ |
| 130 | 141 | public function detectImageText(array $filters = null); |
| @@ -132,8 +143,9 @@ interface MediaRecognition | ||
| 132 | 143 | /** |
| 133 | 144 | * Detects text in a video (OCR). |
| 134 | 145 | * |
| 135 | * @param array|null $filters | |
| 146 | * @param array|null $filters | |
| 136 | 147 | * @return mixed |
| 148 | * | |
| 137 | 149 | * @throws \Exception |
| 138 | 150 | */ |
| 139 | 151 | public function detectVideoText(array $filters = null); |
| @@ -141,9 +153,10 @@ interface MediaRecognition | ||
| 141 | 153 | /** |
| 142 | 154 | * Get the "faces" from the video analysis. |
| 143 | 155 | * |
| 144 | * @param string $jobId | |
| 145 | * @param int $mediaId | |
| 156 | * @param string $jobId | |
| 157 | * @param int $mediaId | |
| 146 | 158 | * @return \Aws\Result |
| 159 | * | |
| 147 | 160 | * @throws \Exception |
| 148 | 161 | */ |
| 149 | 162 | public function getFacesByJobId(string $jobId, int $mediaId); |
| @@ -151,9 +164,10 @@ interface MediaRecognition | ||
| 151 | 164 | /** |
| 152 | 165 | * Get the labels from the video analysis. |
| 153 | 166 | * |
| 154 | * @param string $jobId | |
| 155 | * @param int $mediaId | |
| 167 | * @param string $jobId | |
| 168 | * @param int $mediaId | |
| 156 | 169 | * @return \Aws\Result |
| 170 | * | |
| 157 | 171 | * @throws \Exception |
| 158 | 172 | */ |
| 159 | 173 | public function getLabelsByJobId(string $jobId, int $mediaId); |
| @@ -161,9 +175,10 @@ interface MediaRecognition | ||
| 161 | 175 | /** |
| 162 | 176 | * Get the "content moderation" from the video analysis. |
| 163 | 177 | * |
| 164 | * @param string $jobId | |
| 165 | * @param int $mediaId | |
| 178 | * @param string $jobId | |
| 179 | * @param int $mediaId | |
| 166 | 180 | * @return \Aws\Result |
| 181 | * | |
| 167 | 182 | * @throws \Exception |
| 168 | 183 | */ |
| 169 | 184 | public function getContentModerationByJobId(string $jobId, int $mediaId); |
| @@ -171,9 +186,10 @@ interface MediaRecognition | ||
| 171 | 186 | /** |
| 172 | 187 | * Get the "text detection" from the video analysis. |
| 173 | 188 | * |
| 174 | * @param string $jobId | |
| 175 | * @param int $mediaId | |
| 189 | * @param string $jobId | |
| 190 | * @param int $mediaId | |
| 176 | 191 | * @return \Aws\Result |
| 192 | * | |
| 177 | 193 | * @throws \Exception |
| 178 | 194 | */ |
| 179 | 195 | public function getTextDetectionByJobId(string $jobId, int $mediaId); |
| @@ -18,7 +18,7 @@ class ModerationAnalysisCompleted | ||
| 18 | 18 | * Create a new event instance. |
| 19 | 19 | * |
| 20 | 20 | * @param $message |
| 21 | * @param int|null $mediaId | |
| 21 | * @param int|null $mediaId | |
| 22 | 22 | */ |
| 23 | 23 | public function __construct($message, int $mediaId = null) |
| 24 | 24 | { |
| @@ -52,9 +52,10 @@ class IncomingWebhookController extends Controller | ||
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | /** |
| 55 | * @param string $type | |
| 56 | * @param array $message | |
| 57 | * @param int|null $mediaId | |
| 55 | * @param string $type | |
| 56 | * @param array $message | |
| 57 | * @param int|null $mediaId | |
| 58 | * | |
| 58 | 59 | * @throws \Exception |
| 59 | 60 | */ |
| 60 | 61 | public function fireEventFor(string $type, array $message, int $mediaId = null) |
| @@ -12,8 +12,8 @@ class VerifySignature | ||
| 12 | 12 | /** |
| 13 | 13 | * Handle an incoming request. |
| 14 | 14 | * |
| 15 | * @param \Illuminate\Http\Request $request | |
| 16 | * @param \Closure $next | |
| 15 | * @param \Illuminate\Http\Request $request | |
| 16 | * @param \Closure $next | |
| 17 | 17 | * @return mixed |
| 18 | 18 | */ |
| 19 | 19 | public function handle($request, Closure $next) |
formatting only · 14 hidden lines
| @@ -34,10 +34,10 @@ class StartFaceDetection implements ShouldQueue formatting only | ||
| 34 | 34 | /** |
| 35 | 35 | * Create a new job instance. |
| 36 | 36 | * |
| 37 | * @param string $path | |
| 38 | * @param string|null $mimeType | |
| 39 | * @param int|null $mediaId | |
| 40 | * @param string $faceAttribute | |
| 37 | * @param string $path | |
| 38 | * @param string|null $mimeType | |
| 39 | * @param int|null $mediaId | |
| 40 | * @param string $faceAttribute | |
| 41 | 41 | */ |
| 42 | 42 | public function __construct(string $path, $mimeType = null, $mediaId = null, $faceAttribute = 'DEFAULT') |
| 43 | 43 | { |
| @@ -51,6 +51,7 @@ class StartFaceDetection implements ShouldQueue | ||
| 51 | 51 | * Execute the job. |
| 52 | 52 | * |
| 53 | 53 | * @return void |
| 54 | * | |
| 54 | 55 | * @throws \Exception |
| 55 | 56 | */ |
| 56 | 57 | public function handle() |
formatting only · 16 hidden lines
| @@ -36,11 +36,11 @@ class StartLabelDetection implements ShouldQueue formatting only | ||
| 36 | 36 | /** |
| 37 | 37 | * Create a new job instance. |
| 38 | 38 | * |
| 39 | * @param string $path | |
| 40 | * @param string|null $mimeType | |
| 41 | * @param int|null $mediaId | |
| 42 | * @param int|null $minConfidence | |
| 43 | * @param int $maxResults | |
| 39 | * @param string $path | |
| 40 | * @param string|null $mimeType | |
| 41 | * @param int|null $mediaId | |
| 42 | * @param int|null $minConfidence | |
| 43 | * @param int $maxResults | |
| 44 | 44 | */ |
| 45 | 45 | public function __construct(string $path, $mimeType = null, $mediaId = null, $minConfidence = null, $maxResults = 1000) |
| 46 | 46 | { |
| @@ -55,6 +55,7 @@ class StartLabelDetection implements ShouldQueue | ||
| 55 | 55 | * Execute the job. |
| 56 | 56 | * |
| 57 | 57 | * @return void |
| 58 | * | |
| 58 | 59 | * @throws \Exception |
| 59 | 60 | */ |
| 60 | 61 | public function handle() |
formatting only · 14 hidden lines
| @@ -34,10 +34,10 @@ class StartModerationDetection implements ShouldQueue formatting only | ||
| 34 | 34 | /** |
| 35 | 35 | * Create a new job instance. |
| 36 | 36 | * |
| 37 | * @param string $path | |
| 38 | * @param string|null $mimeType | |
| 39 | * @param int|null $mediaId | |
| 40 | * @param int|null $minConfidence | |
| 37 | * @param string $path | |
| 38 | * @param string|null $mimeType | |
| 39 | * @param int|null $mediaId | |
| 40 | * @param int|null $minConfidence | |
| 41 | 41 | */ |
| 42 | 42 | public function __construct(string $path, $mimeType = null, $mediaId = null, $minConfidence = null) |
| 43 | 43 | { |
| @@ -51,6 +51,7 @@ class StartModerationDetection implements ShouldQueue | ||
| 51 | 51 | * Execute the job. |
| 52 | 52 | * |
| 53 | 53 | * @return void |
| 54 | * | |
| 54 | 55 | * @throws \Exception |
| 55 | 56 | */ |
| 56 | 57 | public function handle() |
formatting only · 14 hidden lines
| @@ -34,10 +34,10 @@ class StartTextDetection implements ShouldQueue formatting only | ||
| 34 | 34 | /** |
| 35 | 35 | * Create a new job instance. |
| 36 | 36 | * |
| 37 | * @param string $path | |
| 38 | * @param string|null $mimeType | |
| 39 | * @param int|null $mediaId | |
| 40 | * @param array $filters | |
| 37 | * @param string $path | |
| 38 | * @param string|null $mimeType | |
| 39 | * @param int|null $mediaId | |
| 40 | * @param array $filters | |
| 41 | 41 | */ |
| 42 | 42 | public function __construct(string $path, $mimeType = null, $mediaId = null, $filters = []) |
| 43 | 43 | { |
| @@ -51,6 +51,7 @@ class StartTextDetection implements ShouldQueue | ||
| 51 | 51 | * Execute the job. |
| 52 | 52 | * |
| 53 | 53 | * @return void |
| 54 | * | |
| 54 | 55 | * @throws \Exception |
| 55 | 56 | */ |
| 56 | 57 | public function handle() |
formatting only · 8 hidden lines
| @@ -13,7 +13,7 @@ class MediaRecognitionManager extends Manager formatting only | ||
| 13 | 13 | /** |
| 14 | 14 | * Get a driver instance. |
| 15 | 15 | * |
| 16 | * @param string|null $name | |
| 16 | * @param string|null $name | |
| 17 | 17 | * @return mixed |
| 18 | 18 | */ |
| 19 | 19 | public function engine($name = null) |
| @@ -25,6 +25,7 @@ class MediaRecognitionManager extends Manager | ||
| 25 | 25 | * Create an Amazon MediaRecognition Converter instance. |
| 26 | 26 | * |
| 27 | 27 | * @return \Meema\MediaRecognition\Recognizers\Rekognition |
| 28 | * | |
| 28 | 29 | * @throws \Exception |
| 29 | 30 | */ |
| 30 | 31 | public function createMediaRecognitionDriver(): Rekognition |
formatting only · 10 hidden lines
| @@ -43,8 +44,8 @@ class MediaRecognitionManager extends Manager formatting only | ||
| 43 | 44 | /** |
| 44 | 45 | * Sets the Recognition client. |
| 45 | 46 | * |
| 46 | * @param array $config | |
| 47 | * @param \Aws\Credentials\Credentials $credentials | |
| 47 | * @param array $config | |
| 48 | * @param \Aws\Credentials\Credentials $credentials | |
| 48 | 49 | * @return \Aws\Rekognition\RekognitionClient |
| 49 | 50 | */ |
| 50 | 51 | protected function setMediaRecognitionClient(array $config, Credentials $credentials): RekognitionClient |
formatting only · 8 hidden lines
| @@ -59,7 +60,7 @@ class MediaRecognitionManager extends Manager formatting only | ||
| 59 | 60 | /** |
| 60 | 61 | * Get credentials of AWS. |
| 61 | 62 | * |
| 62 | * @param array $credentials | |
| 63 | * @param array $credentials | |
| 63 | 64 | * @return \Aws\Credentials\Credentials |
| 64 | 65 | */ |
| 65 | 66 | protected function getCredentials(array $credentials): Credentials |
| @@ -18,6 +18,7 @@ use Illuminate\Database\Eloquent\Relations\MorphTo; | ||
| 18 | 18 | * @property array $ocr |
| 19 | 19 | * @property \Illuminate\Support\Carbon|null $created_at |
| 20 | 20 | * @property \Illuminate\Support\Carbon|null $updated_at |
| 21 | * | |
| 21 | 22 | * @method static \Illuminate\Database\Eloquent\Builder|MediaRecognition newModelQuery() |
| 22 | 23 | * @method static \Illuminate\Database\Eloquent\Builder|MediaRecognition newQuery() |
| 23 | 24 | * @method static \Illuminate\Database\Eloquent\Builder|MediaRecognition query() |
| @@ -36,7 +36,8 @@ class Rekognition implements MediaRecognitionInterface | ||
| 36 | 36 | /** |
| 37 | 37 | * Construct converter. |
| 38 | 38 | * |
| 39 | * @param \Aws\Rekognition\RekognitionClient $client | |
| 39 | * @param \Aws\Rekognition\RekognitionClient $client | |
| 40 | * | |
| 40 | 41 | * @throws \Exception |
| 41 | 42 | */ |
| 42 | 43 | public function __construct(RekognitionClient $client) |
| @@ -57,9 +58,10 @@ class Rekognition implements MediaRecognitionInterface | ||
| 57 | 58 | /** |
| 58 | 59 | * Detects labels/objects in an image. |
| 59 | 60 | * |
| 60 | * @param int|null $minConfidence | |
| 61 | * @param int|null $maxLabels | |
| 61 | * @param int|null $minConfidence | |
| 62 | * @param int|null $maxLabels | |
| 62 | 63 | * @return \Aws\Result |
| 64 | * | |
| 63 | 65 | * @throws \Exception |
| 64 | 66 | */ |
| 65 | 67 | public function detectLabels($minConfidence = null, $maxLabels = null) |
| @@ -86,8 +88,9 @@ class Rekognition implements MediaRecognitionInterface | ||
| 86 | 88 | /** |
| 87 | 89 | * Detects faces in an image & analyzes them. |
| 88 | 90 | * |
| 89 | * @param array $attributes | |
| 91 | * @param array $attributes | |
| 90 | 92 | * @return \Aws\Result |
| 93 | * | |
| 91 | 94 | * @throws \Exception |
| 92 | 95 | */ |
| 93 | 96 | public function detectFaces($attributes = ['DEFAULT']) |
| @@ -117,8 +120,9 @@ class Rekognition implements MediaRecognitionInterface | ||
| 117 | 120 | * Detects moderation labels in an image. |
| 118 | 121 | * This can be useful for children-friendly images or NSFW images. |
| 119 | 122 | * |
| 120 | * @param int|null $minConfidence | |
| 123 | * @param int|null $minConfidence | |
| 121 | 124 | * @return \Aws\Result |
| 125 | * | |
| 122 | 126 | * @throws \Exception |
| 123 | 127 | */ |
| 124 | 128 | public function detectModeration($minConfidence = null) |
| @@ -145,8 +149,9 @@ class Rekognition implements MediaRecognitionInterface | ||
| 145 | 149 | /** |
| 146 | 150 | * Detects text in an image (OCR). |
| 147 | 151 | * |
| 148 | * @param array|null $filters | |
| 152 | * @param array|null $filters | |
| 149 | 153 | * @return \Aws\Result |
| 154 | * | |
| 150 | 155 | * @throws \Exception |
| 151 | 156 | */ |
| 152 | 157 | public function detectText(array $filters = null) |
| @@ -174,6 +179,7 @@ class Rekognition implements MediaRecognitionInterface | ||
| 174 | 179 | * @param $type |
| 175 | 180 | * @param $results |
| 176 | 181 | * @return mixed |
| 182 | * | |
| 177 | 183 | * @throws \Exception |
| 178 | 184 | */ |
| 179 | 185 | protected function updateOrCreate($type, $results) |
| @@ -187,9 +193,10 @@ class Rekognition implements MediaRecognitionInterface | ||
| 187 | 193 | } |
| 188 | 194 | |
| 189 | 195 | /** |
| 190 | * @param string $jobId | |
| 191 | * @param string $type | |
| 196 | * @param string $jobId | |
| 197 | * @param string $type | |
| 192 | 198 | * @return void |
| 199 | * | |
| 193 | 200 | * @throws \Exception |
| 194 | 201 | */ |
| 195 | 202 | protected function updateJobId(string $jobId, string $type) |
formatting only · 12 hidden lines
| @@ -205,9 +212,9 @@ class Rekognition implements MediaRecognitionInterface formatting only | ||
| 205 | 212 | } |
| 206 | 213 | |
| 207 | 214 | /** |
| 208 | * @param array $results | |
| 209 | * @param string $type | |
| 210 | * @param int $mediaId | |
| 215 | * @param array $results | |
| 216 | * @param string $type | |
| 217 | * @param int $mediaId | |
| 211 | 218 | * @return void |
| 212 | 219 | */ |
| 213 | 220 | protected function updateVideoResults(array $results, string $type, int $mediaId) |
| @@ -16,8 +16,7 @@ trait CanRecognizeImages | ||
| 16 | 16 | /** |
| 17 | 17 | * Set the base64 encoded image. |
| 18 | 18 | * |
| 19 | * @param string $blob | |
| 20 | * | |
| 19 | * @param string $blob | |
| 21 | 20 | * @return $this |
| 22 | 21 | */ |
| 23 | 22 | public function blob(string $blob) |
| @@ -31,6 +30,7 @@ trait CanRecognizeImages | ||
| 31 | 30 | * Sets the image to be analyzed. |
| 32 | 31 | * |
| 33 | 32 | * @return void |
| 33 | * | |
| 34 | 34 | * @throws \Exception |
| 35 | 35 | */ |
| 36 | 36 | protected function setImageSettings(): void |
| @@ -61,9 +61,10 @@ trait CanRecognizeImages | ||
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | /** |
| 64 | * @param int|null $minConfidence | |
| 65 | * @param null $maxLabels | |
| 64 | * @param int|null $minConfidence | |
| 65 | * @param null $maxLabels | |
| 66 | 66 | * @return mixed |
| 67 | * | |
| 67 | 68 | * @throws \Exception |
| 68 | 69 | */ |
| 69 | 70 | public function detectImageLabels($minConfidence = null, $maxLabels = null) |
| @@ -88,8 +89,9 @@ trait CanRecognizeImages | ||
| 88 | 89 | } |
| 89 | 90 | |
| 90 | 91 | /** |
| 91 | * @param array $attributes | |
| 92 | * @param array $attributes | |
| 92 | 93 | * @return mixed |
| 94 | * | |
| 93 | 95 | * @throws \Exception |
| 94 | 96 | */ |
| 95 | 97 | public function detectImageFaces($attributes = ['DEFAULT']) |
| @@ -110,8 +112,9 @@ trait CanRecognizeImages | ||
| 110 | 112 | } |
| 111 | 113 | |
| 112 | 114 | /** |
| 113 | * @param int|null $minConfidence | |
| 115 | * @param int|null $minConfidence | |
| 114 | 116 | * @return mixed |
| 117 | * | |
| 115 | 118 | * @throws \Exception |
| 116 | 119 | */ |
| 117 | 120 | public function detectImageModeration($minConfidence = null) |
| @@ -132,8 +135,9 @@ trait CanRecognizeImages | ||
| 132 | 135 | } |
| 133 | 136 | |
| 134 | 137 | /** |
| 135 | * @param array|null $filters | |
| 138 | * @param array|null $filters | |
| 136 | 139 | * @return mixed |
| 140 | * | |
| 137 | 141 | * @throws \Exception |
| 138 | 142 | */ |
| 139 | 143 | public function detectImageText(array $filters = null) |
| @@ -12,6 +12,7 @@ trait CanRecognizeVideos | ||
| 12 | 12 | * |
| 13 | 13 | * @param $type - used to create a readable identifier. |
| 14 | 14 | * @return void |
| 15 | * | |
| 15 | 16 | * @throws \Exception |
| 16 | 17 | */ |
| 17 | 18 | protected function setVideoSettings($type): void |
| @@ -49,9 +50,10 @@ trait CanRecognizeVideos | ||
| 49 | 50 | /** |
| 50 | 51 | * Starts asynchronous detection of labels/objects in a stored video. |
| 51 | 52 | * |
| 52 | * @param int|null $minConfidence | |
| 53 | * @param int $maxResults | |
| 53 | * @param int|null $minConfidence | |
| 54 | * @param int $maxResults | |
| 54 | 55 | * @return \Aws\Result |
| 56 | * | |
| 55 | 57 | * @throws \Exception |
| 56 | 58 | */ |
| 57 | 59 | public function detectVideoLabels($minConfidence = null, $maxResults = 1000) |
| @@ -70,8 +72,9 @@ trait CanRecognizeVideos | ||
| 70 | 72 | } |
| 71 | 73 | |
| 72 | 74 | /** |
| 73 | * @param array $attributes | |
| 75 | * @param array $attributes | |
| 74 | 76 | * @return mixed |
| 77 | * | |
| 75 | 78 | * @throws \Exception |
| 76 | 79 | */ |
| 77 | 80 | public function detectVideoFaces($attributes = 'DEFAULT') |
| @@ -92,8 +95,9 @@ trait CanRecognizeVideos | ||
| 92 | 95 | /** |
| 93 | 96 | * Starts asynchronous detection of unsafe content in a stored video. |
| 94 | 97 | * |
| 95 | * @param int|null $minConfidence | |
| 98 | * @param int|null $minConfidence | |
| 96 | 99 | * @return mixed |
| 100 | * | |
| 97 | 101 | * @throws \Exception |
| 98 | 102 | */ |
| 99 | 103 | public function detectVideoModeration($minConfidence = null) |
| @@ -114,8 +118,9 @@ trait CanRecognizeVideos | ||
| 114 | 118 | /** |
| 115 | 119 | * Starts asynchronous detection of text in a stored video. |
| 116 | 120 | * |
| 117 | * @param array|null $filters | |
| 121 | * @param array|null $filters | |
| 118 | 122 | * @return mixed |
| 123 | * | |
| 119 | 124 | * @throws \Exception |
| 120 | 125 | */ |
| 121 | 126 | public function detectVideoText(array $filters = null) |
| @@ -138,9 +143,10 @@ trait CanRecognizeVideos | ||
| 138 | 143 | /** |
| 139 | 144 | * Get the labels from the video analysis. |
| 140 | 145 | * |
| 141 | * @param string $jobId | |
| 142 | * @param int|null $mediaId | |
| 146 | * @param string $jobId | |
| 147 | * @param int|null $mediaId | |
| 143 | 148 | * @return \Aws\Result |
| 149 | * | |
| 144 | 150 | * @throws \Exception |
| 145 | 151 | */ |
| 146 | 152 | public function getLabelsByJobId(string $jobId, int $mediaId = null) |
| @@ -161,9 +167,10 @@ trait CanRecognizeVideos | ||
| 161 | 167 | /** |
| 162 | 168 | * Get the faces from the video analysis. |
| 163 | 169 | * |
| 164 | * @param string $jobId | |
| 165 | * @param int|null $mediaId | |
| 170 | * @param string $jobId | |
| 171 | * @param int|null $mediaId | |
| 166 | 172 | * @return \Aws\Result |
| 173 | * | |
| 167 | 174 | * @throws \Exception |
| 168 | 175 | */ |
| 169 | 176 | public function getFacesByJobId(string $jobId, int $mediaId = null) |
| @@ -184,9 +191,10 @@ trait CanRecognizeVideos | ||
| 184 | 191 | /** |
| 185 | 192 | * Get the "content moderation" from the video analysis. |
| 186 | 193 | * |
| 187 | * @param string $jobId | |
| 188 | * @param int|null $mediaId | |
| 194 | * @param string $jobId | |
| 195 | * @param int|null $mediaId | |
| 189 | 196 | * @return \Aws\Result |
| 197 | * | |
| 190 | 198 | * @throws \Exception |
| 191 | 199 | */ |
| 192 | 200 | public function getContentModerationByJobId(string $jobId, int $mediaId = null) |
| @@ -207,9 +215,10 @@ trait CanRecognizeVideos | ||
| 207 | 215 | /** |
| 208 | 216 | * Get the faces from a video analysis. |
| 209 | 217 | * |
| 210 | * @param string $jobId | |
| 211 | * @param int|null $mediaId | |
| 218 | * @param string $jobId | |
| 219 | * @param int|null $mediaId | |
| 212 | 220 | * @return \Aws\Result |
| 221 | * | |
| 213 | 222 | * @throws \Exception |
| 214 | 223 | */ |
| 215 | 224 | public function getTextDetectionByJobId(string $jobId, int $mediaId = null) |
formatting only · 8 hidden lines
| @@ -35,7 +35,7 @@ trait InteractsWithStorage formatting only | ||
| 35 | 35 | /** |
| 36 | 36 | * Set which S3 disk to use. |
| 37 | 37 | * |
| 38 | * @param string $disk | |
| 38 | * @param string $disk | |
| 39 | 39 | * @return $this |
| 40 | 40 | */ |
| 41 | 41 | public function disk(string $disk) |
formatting only · 12 hidden lines
| @@ -48,9 +48,9 @@ trait InteractsWithStorage formatting only | ||
| 48 | 48 | /** |
| 49 | 49 | * The equivalent of the S3 Key / the path of the file inside the bucket. |
| 50 | 50 | * |
| 51 | * @param string $source | |
| 52 | * @param string|null $mimeType | |
| 53 | * @param int|null $mediaId | |
| 51 | * @param string $source | |
| 52 | * @param string|null $mimeType | |
| 53 | * @param int|null $mediaId | |
| 54 | 54 | * @return $this |
| 55 | 55 | */ |
| 56 | 56 | public function source(string $source, string $mimeType = null, int $mediaId = null) |
formatting only · 12 hidden lines
| @@ -65,9 +65,9 @@ trait InteractsWithStorage formatting only | ||
| 65 | 65 | /** |
| 66 | 66 | * Alias of source(). |
| 67 | 67 | * |
| 68 | * @param string $source | |
| 69 | * @param string|null $mimeType | |
| 70 | * @param int|null $mediaId | |
| 68 | * @param string $source | |
| 69 | * @param string|null $mimeType | |
| 70 | * @param int|null $mediaId | |
| 71 | 71 | * @return $this |
| 72 | 72 | */ |
| 73 | 73 | public function path(string $source, string $mimeType = null, int $mediaId = null) |
| @@ -79,6 +79,7 @@ trait InteractsWithStorage | ||
| 79 | 79 | * Ensures the source/path not to be null if it is null it will thrown an exception. |
| 80 | 80 | * |
| 81 | 81 | * @return void |
| 82 | * | |
| 82 | 83 | * @throws \Exception |
| 83 | 84 | */ |
| 84 | 85 | public function ensureSourceIsNotNull() |
| @@ -20,8 +20,8 @@ trait Recognizable | ||
| 20 | 20 | /** |
| 21 | 21 | * Start a media "recognition". |
| 22 | 22 | * |
| 23 | * @param string $path | |
| 24 | * @param string|null $mimeType | |
| 23 | * @param string $path | |
| 24 | * @param string|null $mimeType | |
| 25 | 25 | * @return \Meema\MediaRecognition\Contracts\MediaRecognition |
| 26 | 26 | */ |
| 27 | 27 | public function recognize(string $path, string $mimeType = null) |