Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use for loop to vist all file? #42

Closed
aprillefou666 opened this issue Nov 16, 2022 · 3 comments
Closed

How to use for loop to vist all file? #42

aprillefou666 opened this issue Nov 16, 2022 · 3 comments

Comments

@aprillefou666
Copy link

aprillefou666 commented Nov 16, 2022

​Hi,
I try to produce lots of images at once,
like codes below,but it seems it doesn't work,
​How can I make it work? ​Thanks a lot

[in]:
import os
DOG = os.listdir("/content/drive/MyDrive/FaceSwap-master/dog")

for i in DOG:
!python main.py --src imgs/kage.jpg --dst DOG/i --out results/i --correct_color

[out]:
[ WARN:0@1.155] global /io/opencv/modules/imgcodecs/src/loadsave.cpp (239) findDecoder imread_('DOG/i'): can't open/read file: check file path/integrity
Traceback (most recent call last):
File "main.py", line 27, in
dst_faceBoxes = select_all_faces(dst_img)
File "/content/drive/MyDrive/FaceSwap-master/face_detection.py", line 74, in select_all_faces
faces = face_detection(im)
File "/content/drive/MyDrive/FaceSwap-master/face_detection.py", line 11, in face_detection
faces = detector(img, upsample_times)
TypeError: call(): incompatible function arguments. The following argument types are supported:
1. (self: _dlib_pybind11.fhog_object_detector, image: array, upsample_num_times: int=0) -> _dlib_pybind11.rectangles

@wuhuikai
Copy link
Owner

Is DOG/i an image?

@aprillefou666
Copy link
Author

"DOG" is a folder
"i" is "for i"

thx

@wuhuikai
Copy link
Owner

wuhuikai commented Dec 1, 2022

--dst must be an image

@wuhuikai wuhuikai closed this as completed Dec 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants