by Vox_Leone · 1y ago · 0 comments
Example of a Structured Pseudo-Code Prompt:
Let’s say you want to generate code for a function that handles object detection:
'''Function: object_detection Input: image Output: list of detected objects
Steps: 1. Initialize model (load pretrained object detection model)
2. Preprocess the image (resize, normalize, etc.)
3. Run the image through the model
4. Extract bounding boxes and confidence scores from the model's output
5. Return objects with confidence greater than 0.5 as a list of tuples (object_name, bounding_box)
Language: Python'''