Comments (9)
from cnn_face_detection.
Hi,
Sorry, the script is indeed kind of messy!
I think you can try modifying line 51 to exit(0)
instead of break
from cnn_face_detection.
from cnn_face_detection.
Try adding print(number_of_pictures)
on next line of line 14,
what does it print?
from cnn_face_detection.
from cnn_face_detection.
I have added some lines in the code, is it OK?
for current_image in range((current_neg_dir - 1)*300, (current_neg_dir - 1)*300 + 300): # take 300 images
if current_image > (number_of_pictures - 1):
break
if current_image % 100 == 0:
print "Processing image number " + str(current_image)
read_img_name = data_base_dir + '/' + file_list[current_image].strip()
img = cv2.imread(read_img_name) # read image
height, width, channels = img.shape
crop_size = min(height, width) / 2 # start from half of shorter side
while crop_size >= 12:
for start_height in range(0, height, 100):
if (start_height + crop_size) > height:
break
for start_width in range(0, width, 100):
if (start_width + crop_size) > width:
break
cropped_img = img[start_height : start_height + int(crop_size), start_width : start_width + int(crop_size)]
from cnn_face_detection.
Yes, this should work!
from cnn_face_detection.
Hello, i'm also a beginner.
When i tried to modify the codes as you discuss.
It still said:"IndexError: list index out of range".
plz help me, thank you.
from cnn_face_detection.
Hi Hong,
I think the problem is wrong indentation compared to the code microhua pasted.
The code with the line starting from read_img_name should be indented to the right.
for current_image in range((current_neg_dir - 1)*300, (current_neg_dir - 1)*300 + 300): # take 300 images
if current_image > (number_of_pictures - 1):
break
if current_image % 100 == 0:
print "Processing image number " + str(current_image)
read_img_name = data_base_dir + '/' + file_list[current_image].strip()
img = cv2.imread(read_img_name) # read image
height, width, channels = img.shape
crop_size = min(height, width) / 2 # start from half of shorter side
while crop_size >= 12:
for start_height in range(0, height, 100):
if (start_height + crop_size) > height:
break
for start_width in range(0, width, 100):
if (start_width + crop_size) > width:
break
cropped_img = img[start_height : start_height + int(crop_size), start_width : start_width + int(crop_size)]
from cnn_face_detection.
Related Issues (20)
- approximate Threshold T1 and T2 HOT 4
- About the result after running HOT 4
- Number of face detected in 2002/07/19/big/img_352.jpg HOT 1
- About the training step HOT 4
- A question about the cascade cnn HOT 2
- About the face size in create_face_12c.sh HOT 6
- How to train calibration nets?
- 3000 images without any faces (negative images) HOT 2
- How to implement the Multi-resolution net structure HOT 5
- Speed Problem HOT 1
- AFLW new website can't find AFLW_Faces.txt HOT 1
- train_val.prototxt about FCN HOT 3
- many false face HOT 1
- calibration_AFLW.py new code HOT 5
- Resize images when creatiing LMDB file HOT 2
- About the training step HOT 1
- About the test result HOT 1
- How to get the file face12c_full_conv.caffemodel HOT 2
- How to python caffe to test the model
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cnn_face_detection.