motorcitycobra / face_ripper_9000 Goto Github PK
View Code? Open in Web Editor NEWCreates 256 cropped, high quality facesets from a batch of mp4 videos end to end
License: MIT License
Creates 256 cropped, high quality facesets from a batch of mp4 videos end to end
License: MIT License
File "demo.py", line 161, in
os.rename(i, too_small + "/too small-" + str(counter) + random_string(15) + ".jpg")
NameError: name 'random_string' is not defined
What could be the problem here? What is -i?
This wasn't happening on my Mac, but it's happening on my Windows machine. For some reason, after the first video selected in my mp4 set has finished extracting, the script stops and prints this message:
Traceback (most recent call last):
File "demo.py", line 146, in <module>
os.rename(vid, scanned_vids + '/vid' + str(zz) + '_' + random_string(5) + '.mp4')
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: '\\Path\\to\\input\\video\\a.mp4' -> '\\Path\\to\\output\\video/b.mp4'
PS \path\to\face\ripper\directory>
PS \path\to\face\ripper\directory>
The forward slash before b.mp4 and the double backwards slashes aren't typos, that's just how it's printing out.
@MotorCityCobra You state in your readme the compile option -DDLIB_USE_CUDA=0
and when installing --no DLIB_USE_CUDA
Are you sure? Because when compiling with this argument and running the process my GPU isn't used at all. Extract process runs fine nevertheless but CPU is maxed out.
Windows 10
All deps working
When issuing
python demo.py -i D:\fakes\data\target.jpg -v D:\fakes\data\mp4dir\
I get this:
Target filename: D:\fakes\data\target.jpg.
Video input directory: D:\fakes\data\mp4dir.
Tolerance: 0.6.
Number of confirmed faces saved from each video: 1000.
Using OpenCL: True.
Output directory: D:\fakes\data\mp4dir_output.
Scanned videos will be moved to: D:\fakes\data\mp4dir_scanned_vids.
Moving demo.py to the too small folder
Moving LICENSE to the too small folder
Moving README.md to the too small folder
Now double checking there is only one face in each photo
And all files are moved to the too small folder and renamed into jpgs and nothing else is extracted.
too small-0cIqXbWehwKRcTtt.jpg
EDIT
on the second try with the exact same command (after I unpcked the py again) everything worked. Seems still like a logic mistake.
Running in either a CMD or Powershell as an admin I get the error in the title, I've tried moving the target folder to multiple different locations (downloads, desktop etc) and get the same error.
This is what gets output: http://prntscr.com/ii3obg
Ignore me, I completely forgot to actually specify the image in the face folder each time, I just specified the folder the image was in.
I'm running Anaconda python 3.5 on Win 10 x64, and the dependencies are installed. I've recompiled OpenCV and Dlib to use CUDA. I'm a python beginner. I'm trying to extract pics from a video, both are on the same drive and in the same directory. There are no spaces or special characters in the target directory or filename.
The error message points to line 159 of demo.py, "in (module) (os.rename + /too small+str(counter) +random string(15) + "*.jpg")
and then OS Error [Win Error 17] The system cannot move the file to a different disk drive.
Unfortunately, I don't know enough python to troubleshoot. How to resolve the error?
Wasn't sure where to put this, but I guess technically it could be considered an 'issue' so I think posting it here isn't entirely wrong.
To make your code more accessible to general users, I wrote out a (Mac) tutorial for /v/facesets, including how to install all the dependencies correctly, that's aimed at people who've never used a command line before. I'm working on creating another one aimed at PC users, but in the meantime, you can take what I wrote and put it in the README if you'd like. You might think it's a bit too dumbed-down though, so it's up to you.
When I try to run
python3 demo.py -i 'example/path/pic.jpg' -v 'example/path/videos'
I get an error message saying
Traceback (most recent call last):
File "demo.py", line 3, in <module>
import cv2
ImportError: No module named 'cv2'
But from the same directory, I can open up python and run
>>> import cv2
>>> cv2.__version__
And it'll spit out '3.4.0'
so It's definitely installed?
Any idea what might be causing this? @MotorCityCobra
Do the directories have to be laid out in a specific way?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.