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
72 changes: 72 additions & 0 deletions lib/TaskProcessing/AudioClassificationTaskType.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<?php

declare(strict_types=1);

/**
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

namespace OCA\Recognize\TaskProcessing;

use OCA\Recognize\AppInfo\Application;
use OCP\IL10N;
use OCP\TaskProcessing\EShapeType;
use OCP\TaskProcessing\ITaskType;
use OCP\TaskProcessing\ShapeDescriptor;

final class AudioClassificationTaskType implements ITaskType {
public const ID = Application::APP_ID . ':audio:classification';

public function __construct(
private IL10N $l,
) {
}

/**
* @inheritDoc
*/
public function getName(): string {
return $this->l->t('Audio classification');
}

/**
* @inheritDoc
*/
public function getDescription(): string {
return $this->l->t('Classify audios into categories.');
}

/**
* @return string
*/
public function getId(): string {
return self::ID;
}

/**
* @return ShapeDescriptor[]
*/
public function getInputShape(): array {
return [
'input' => new ShapeDescriptor(
$this->l->t('Audios'),
$this->l->t('Provide audios to classify'),
EShapeType::ListOfAudios,
),
];
}

/**
* @return ShapeDescriptor[]
*/
public function getOutputShape(): array {
return [
'output' => new ShapeDescriptor(
$this->l->t('Categories'),
$this->l->t('The classified categories. Each input audio is mapped to a text containing a comma separated list of categories.'),
EShapeType::ListOfTexts,
),
];
}
}
72 changes: 72 additions & 0 deletions lib/TaskProcessing/ImageClassificationTaskType.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<?php

declare(strict_types=1);

/**
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

namespace OCA\Recognize\TaskProcessing;

use OCA\Recognize\AppInfo\Application;
use OCP\IL10N;
use OCP\TaskProcessing\EShapeType;
use OCP\TaskProcessing\ITaskType;
use OCP\TaskProcessing\ShapeDescriptor;

final class ImageClassificationTaskType implements ITaskType {
public const ID = Application::APP_ID . ':image:classification';

public function __construct(
private IL10N $l,
) {
}

/**
* @inheritDoc
*/
public function getName(): string {
return $this->l->t('Image classification');
}

/**
* @inheritDoc
*/
public function getDescription(): string {
return $this->l->t('Classify images into categories.');
}

/**
* @return string
*/
public function getId(): string {
return self::ID;
}

/**
* @return ShapeDescriptor[]
*/
public function getInputShape(): array {
return [
'input' => new ShapeDescriptor(
$this->l->t('Images'),
$this->l->t('Provide images to classify'),
EShapeType::ListOfImages,
),
];
}

/**
* @return ShapeDescriptor[]
*/
public function getOutputShape(): array {
return [
'output' => new ShapeDescriptor(
$this->l->t('Categories'),
$this->l->t('The classified categories. Each input image is mapped to a text containing a comma separated list of categories.'),
EShapeType::ListOfTexts,
),
];
}
}
72 changes: 72 additions & 0 deletions lib/TaskProcessing/ImageFaceRecognitionTaskType.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<?php

declare(strict_types=1);

/**
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

namespace OCA\Recognize\TaskProcessing;

use OCA\Recognize\AppInfo\Application;
use OCP\IL10N;
use OCP\TaskProcessing\EShapeType;
use OCP\TaskProcessing\ITaskType;
use OCP\TaskProcessing\ShapeDescriptor;

final class ImageFaceRecognitionTaskType implements ITaskType {
public const ID = Application::APP_ID . ':image:facerecognition';

public function __construct(
private IL10N $l,
) {
}

/**
* @inheritDoc
*/
public function getName(): string {
return $this->l->t('Image face recognition');
}

/**
* @inheritDoc
*/
public function getDescription(): string {
return $this->l->t('Recognize faces in images and return embedding vectors for each face.');
}

/**
* @return string
*/
public function getId(): string {
return self::ID;
}

/**
* @return ShapeDescriptor[]
*/
public function getInputShape(): array {
return [
'input' => new ShapeDescriptor(
$this->l->t('Images'),
$this->l->t('Provide images to recognize faces in'),
EShapeType::ListOfImages,
),
];
}

/**
* @return ShapeDescriptor[]
*/
public function getOutputShape(): array {
return [
'output' => new ShapeDescriptor(
$this->l->t('Faces'),
$this->l->t('The detected faces. Each input image is mapped to a text containing JSON-encoded embedding vectors separated by line breaks.'),
EShapeType::ListOfTexts,
),
];
}
}
72 changes: 72 additions & 0 deletions lib/TaskProcessing/VideoClassificationTaskType.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<?php

declare(strict_types=1);

/**
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

namespace OCA\Recognize\TaskProcessing;

use OCA\Recognize\AppInfo\Application;
use OCP\IL10N;
use OCP\TaskProcessing\EShapeType;
use OCP\TaskProcessing\ITaskType;
use OCP\TaskProcessing\ShapeDescriptor;

final class VideoClassificationTaskType implements ITaskType {
public const ID = Application::APP_ID . ':video:classification';

public function __construct(
private IL10N $l,
) {
}

/**
* @inheritDoc
*/
public function getName(): string {
return $this->l->t('Video classification');
}

/**
* @inheritDoc
*/
public function getDescription(): string {
return $this->l->t('Classify videos into categories.');
}

/**
* @return string
*/
public function getId(): string {
return self::ID;
}

/**
* @return ShapeDescriptor[]
*/
public function getInputShape(): array {
return [
'input' => new ShapeDescriptor(
$this->l->t('Videos'),
$this->l->t('Provide videos to classify'),
EShapeType::ListOfVideos,
),
];
}

/**
* @return ShapeDescriptor[]
*/
public function getOutputShape(): array {
return [
'output' => new ShapeDescriptor(
$this->l->t('Categories'),
$this->l->t('The classified categories. Each input video is mapped to a text containing a comma separated list of categories.'),
EShapeType::ListOfTexts,
),
];
}
}
Loading