Closed thekryz closed 4 years ago
Hi, I have met the same question. Have you solved it?
I have met the same problem, when i try to reduce the version of opencv-python to 3 and reinstall ffmpeg, this probem did not recur
The "alpha" argument is the second argument in https://github.com/zh-plus/video-to-pose3D/blob/b09374082557a6228d14e7d11ef09fa12b25cae8/joints_detectors/Alphapose/fn.py#L198
Since I cannot reproduce this issue, you can set a breakpoint there and see if the value of transparency
cannot be converted to double. From my point of view, replacing transparency
by float(transparency)
may help.
Also, it may be caused by the incompatibility of opencv-python
package. In my environment, the version is 4.1.0.25
, which may help addressing this issue.
have you solved the problem yet? plz help
Might be a bit late but did you make sure that alpha was the correct data type? For example, if alpha was supposed to be an integer, did you use the int() method or ensure that the value that would replace alpha is an integer?
Same problem.
I found the type of transparency
is a torch.Tensor
, so using torch.tensor(3.14).item()
to get real value.
transparency = max(0, min(1, kp_scores[n])).item()
# ...
transparency = max(0, min(1, 0.5 * (kp_scores[start_p] + kp_scores[end_p]))).item()
I have met the same problem, when i try to reduce the version of opencv-python to 3 and reinstall ffmpeg, this probem did not recur
It works,really thanks
I encountered a similar issue with the function 'AddWeighted'. However, I was able to address the problem by developing a custom function, which works well. The problem arose when I attempted to pass an array as an alpha parameter, resulting in the error 'Argument alpha cannot be treated as a double'. Consequently, I sought to investigate the underlying issue and, as a solution, introduced a new function named 'customAddWeighted'.
To see the full code: https://github.com/javadasoodeh/CV/blob/main/opencv_basic/alpha_blending.py
_Please note that the provided link may be subject to change. To access the relevant information, kindly navigate to the 'https://github.com/javadasoodeh/CV' section and search for the file name 'alphablending.py'.
def customAddWeighted(src1, alpha, src2, beta, gamma=0):
# Check if the images have the same size
if src1.shape != src2.shape:
raise ValueError("Input images must have the same size.")
# Perform alpha blending
blended_image = np.clip(src1 * alpha[:, :, np.newaxis] + src2 * beta[:, :, np.newaxis] + gamma, 0, 255).astype(
np.uint8)
return blended_image
When I try to run python videopose.py with the demo video, I get the message "Argument 'alpha' can not be treated as a double:
The script seems to continue, though I'm not sure if it eventually finishes, since I had to interrupt.