Face Detection(OpenCV) Using Hadoop Streaming API: 代码.
cd /home/liupeng/hadoop/Face_Detection_Using_Hadoop_Streaming_API/
rm -f deploy/Imageprocessing.zip
zip -q -r deploy/Imageprocessing.zip Imageprocessing/
python DataPreProcessing.py /home/liupeng/hadoop/Face_Detection_Using_Hadoop_Streaming_API/images/ SerializedImages.txt
cp SerializedImages.txt /tmp/liupeng/
cd ~
# 脚本权限
chmod +x /home/liupeng/hadoop/Face_Detection_Using_Hadoop_Streaming_API/*
cd /usr/local/hadoop
# 在我们运行MapReduce job 前,我们需要将本地的文件复制到HDFS中
# /tmp/liupeng/SerializedImages.txt
liupeng@1:/usr/local/hadoop$ bin/hadoop dfs -copyFromLocal /tmp/liupeng liupeng
# 执行 MapReduce job
liupeng@1:/usr/local/hadoop$ bin/hadoop jar share/hadoop/tools/lib/hadoop-streaming-2.8.1.jar
-file /home/liupeng/hadoop/Face_Detection_Using_Hadoop_Streaming_API/FaceDetectorRun.py
-file /home/liupeng/hadoop/Face_Detection_Using_Hadoop_Streaming_API/deploy/Imageprocessing.zip
-file /home/liupeng/hadoop/Face_Detection_Using_Hadoop_Streaming_API/Classifier/haarcascade_frontalface_default.xml
-mapper /home/liupeng/hadoop/Face_Detection_Using_Hadoop_Streaming_API/FaceDetectorRun.py
-input liupeng/* -output liupeng-output
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有