cellmap_flow.ai_annotate.prompts
The prompt that asks an image model to paint one structure in an EM plane.
Adapted from ask-to-mask’s detailed prompt: what the image is, its resolution, how the structure looks in EM (when the catalog knows it), and the instruction to paint it one colour on black. The user may replace the description and instruction with their own text; the resolution and the instance-separation sentence are added either way, since the first depends on the plane actually sent and the second on how the mask is used.
Attributes
Functions
|
The part of the prompt the user may edit, as the catalog writes it. |
|
The recolor prompt for one EM plane. |
Module Contents
- cellmap_flow.ai_annotate.prompts.MAX_PROMPT_CHARS = 4000
- cellmap_flow.ai_annotate.prompts.SENTENCES
- cellmap_flow.ai_annotate.prompts.editable_prompt(profile: cellmap_flow.ai_annotate.organelles.OrganelleProfile) str
The part of the prompt the user may edit, as the catalog writes it.
This is what the dashboard prefills the prompt box with. Sending it back unedited as
prompt_overridegives exactly the prompt no override gives, so prefilling never changes what the model is asked.
- cellmap_flow.ai_annotate.prompts.build_recolor_prompt(profile: cellmap_flow.ai_annotate.organelles.OrganelleProfile, resolution_nm: float | None = None, prompt_override: str | None = None) str
The recolor prompt for one EM plane.
The resolution sentence (
resolution_nmis the in-plane size of a pixel of the image actually sent), then the editable part, then the instance-separation sentence. The editable part isprompt_overridewhen it has text (a user’s dataset-specific wording), else the catalog’seditable_prompt. An override longer thanMAX_PROMPT_CHARSis refused (400); the sentences added around it are short and fixed, so the cap is on the part the user writes.