now.apps.image_to_image.app module#

class now.apps.image_to_image.app.ImageToImage[source]#

Bases: now.apps.base.app.JinaNOWApp

property app_name: str#

Name of the app. Should be an enum value set in now.constants.Apps

Return type

str

property is_enabled: bool#

Set to True if this app is enabled for the end user.

Return type

bool

property description: str#

Short description of the app.

Return type

str

property input_modality: now.constants.Modalities#

Modality used for running search queries

Return type

Modalities

property output_modality: now.constants.Modalities#

Modality used for indexing data

Return type

Modalities

property required_docker_memory_in_gb: int#

Recommended memory limit for the docker client to run this app.

Return type

int

property finetune_datasets: [Tuple]#

Defines the list of demo datasets which are fine-tunable.

Return type

[Tuple]

set_flow_yaml(**kwargs)[source]#

Used to configure the flow yaml in the Jina NOW app. The interface is as follows: - if kwargs[‘finetuning’]=True, choose finetuning flow - if kwargs[‘encode’]=True, choose encoding flow (to get embeddings for finetuning) - temporarily introduced kwargs[‘dataset_len’], if app optimizes different flows to it

property supported_file_types: List[str]#

Used to filter files in local structure or an S3 bucket.

Return type

List[str]

setup(dataset, user_input, kubectl_path)[source]#

Runs before the flow is deployed. Common use cases:

  • create a database

  • finetune a model + push the artifact

  • notify other services

  • check if starting the app is currently possible

Parameters
  • dataset (DocumentArray) –

  • user_input (UserInput) – user configuration based on the given options

Return type

Dict

Returns

dict used to replace variables in flow yaml and to clean up resources after the flow is terminated

preprocess(da, user_input, is_indexing=False)[source]#

Loads and preprocesses every document such that it is ready for finetuning/indexing.

Return type

DocumentArray