我正在尝试使用 amplify 和 React js 将文件上传到 AWS,但我得到了一个 07:55.748 AWSS3Provider - error uploading Error: Region is missing
.
这是我正在使用的代码。我什至尝试对该区域进行硬编码,但它仍然不起作用。
import { v4 as uuid } from 'uuid';
import { withAuthenticator } from '@aws-amplify/ui-react';
import { createDrawing as CreateDrawing } from '../graphql/mutations';
import { listDrawings as ListDrawings } from '../graphql/queries';
import config from '../aws-exports';
const { aws_user_files_s3_bucket: bucket } = config;
export const listDrawings = async () => {
const images = await API.graphql(graphqlOperation(ListDrawings));
console.log(images.data.listDrawings.items);
return images;
};
export const createDrawing = …
Run Code Online (Sandbox Code Playgroud) javascript amazon-s3 amazon-web-services reactjs aws-amplify
因此,我尝试使用此代码显示仅黑白图像的二进制图片:
import cv2
import numpy as np
x_img = cv2.imread("lenac.tif")
x_img_g = cv2.cvtColor(x_img, cv2.COLOR_BGR2GRAY)
y = x_img_g > 128
cv2.imshow("", y*1.0)
cv2.waitKey(0)
cv2.destroyAllWindows()
Run Code Online (Sandbox Code Playgroud)
但我收到此错误:
>Traceback (most recent call last):
File "ex5.py", line 11, in <module>
cv2.imshow("", y*1.0)
cv2.error: OpenCV(4.0.0) c:\projects\opencv-
python\opencv\modules\imgproc\src\color.hpp:261: error: (-2:Unspecified
error) >in function '__cdecl cv::CvtHelper<struct
cv::Set<1,-1,-1>,struct cv::Set<3,4,-1>,struct
cv::Set<0,2,5>,2>::CvtHelper(const class cv::_InputArray &,const class
cv::_OutputArray &,int)'
>Unsupported depth of input image:
> 'VDepth::contains(depth)'
> where
> 'depth' is 6 (CV_64F).
Run Code Online (Sandbox Code Playgroud) 我知道我必须使用 ,xsl:import
但我不知道如何调用name
模板的 。
我该怎么做?
amazon-s3 ×1
aws-amplify ×1
import ×1
javascript ×1
numpy ×1
opencv ×1
python ×1
reactjs ×1
stylesheet ×1
xml ×1
xslt ×1