根據規範創建 Python 函數。
提示
用戶
編寫一個 Python 函數,将圖像的文件路徑作為輸入,将圖像作為 numpy 數組加載到内存中,然後在周邊的行和列比阈值暗時裁剪它們。 使用行和列的平均值來決定是否應将它們标記為删除。
API請求
{
"model": "gpt-4",
"messages": [
{
"role": "user",
"content": "Write a Python function that takes as input a file path to an image, loads the image into memory as a numpy array, then crops the rows and columns around the perimeter if they are darker than a threshold value. Use the mean value of rows and columns to decide if they should be marked for deletion."
}
],
"temperature": 0,
"max_tokens": 1024
}
评论