小编Gui*_*ble的帖子

区域丢失错误 - AWS Amplify React

我正在尝试使用 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

5
推荐指数
1
解决办法
6063
查看次数

python:不支持图像的OpenCV深度(CV_64F)

因此,我尝试使用此代码显示仅黑白图像的二进制图片:

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)

python opencv numpy

3
推荐指数
2
解决办法
4145
查看次数

如何从另一个样式表导入模板?

我知道我必须使用 ,xsl:import但我不知道如何调用name模板的 。

我该怎么做?

xml xslt import stylesheet

0
推荐指数
1
解决办法
1687
查看次数