Skip to content
This repository has been archived by the owner on Jul 15, 2022. It is now read-only.

猫脸检测及识别 - Rainbow #36

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions 1 遗失宠物的智能寻找/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,68 @@
如果可以通过人工智能的方式解决这一难题,相信将成为不少养宠家庭的福音——“狗脸识别”、智能追踪设备、“离家出走”路线预测……

请以“遗失宠物的智能寻找”为主题,利用人工智能技术完成一款产品(软件或硬件)的开发。

---

* 作品介绍:

猫是人们最喜欢的宠物之一,很多人都拜倒在了它们的魅力之下,成为了一名光荣的铲屎官。那么,如果你的小主子不幸走失了,你一定会心机如焚的去寻找。本项目致力解决这一问题,希望可以快速的在图片和视频中框选出猫咪的位置,从而发现猫咪的运动轨迹,最终成功接小主子回家。另外,本项目还可以从图片中选出猫脸所在的区域,将该区域放入SVM分类器中进行训练,进而对猫脸进行识别,这样就可以通过监控路线自动的检测你的猫咪的所在位置,大大减少了人工的工作量。

本项目使用imglab对猫脸图片进行标注

* 作品截图:

猫脸检测效果图一:

![1](https://github.com/CCCGX/aws-hackathon-2020/blob/master/1%20%E9%81%97%E5%A4%B1%E5%AE%A0%E7%89%A9%E7%9A%84%E6%99%BA%E8%83%BD%E5%AF%BB%E6%89%BE/%E7%8C%AB%E8%84%B8%E6%A3%80%E6%B5%8B%E5%8F%8A%E8%AF%86%E5%88%AB%20-%20Rainbow/res1.png?raw=true)

猫脸检测效果图二:

![2](https://github.com/CCCGX/aws-hackathon-2020/blob/master/1%20%E9%81%97%E5%A4%B1%E5%AE%A0%E7%89%A9%E7%9A%84%E6%99%BA%E8%83%BD%E5%AF%BB%E6%89%BE/%E7%8C%AB%E8%84%B8%E6%A3%80%E6%B5%8B%E5%8F%8A%E8%AF%86%E5%88%AB%20-%20Rainbow/res2.png?raw=true)

猫脸检测效果图三:(可以很好的识别出猫和狗的区别,opencv自带的猫脸检测就不能很好的做到这一点)

![3](https://github.com/CCCGX/aws-hackathon-2020/blob/master/1%20%E9%81%97%E5%A4%B1%E5%AE%A0%E7%89%A9%E7%9A%84%E6%99%BA%E8%83%BD%E5%AF%BB%E6%89%BE/%E7%8C%AB%E8%84%B8%E6%A3%80%E6%B5%8B%E5%8F%8A%E8%AF%86%E5%88%AB%20-%20Rainbow/res3.png?raw=true)

猫脸检测效果图四:

![4](https://github.com/CCCGX/aws-hackathon-2020/blob/master/1%20%E9%81%97%E5%A4%B1%E5%AE%A0%E7%89%A9%E7%9A%84%E6%99%BA%E8%83%BD%E5%AF%BB%E6%89%BE/%E7%8C%AB%E8%84%B8%E6%A3%80%E6%B5%8B%E5%8F%8A%E8%AF%86%E5%88%AB%20-%20Rainbow/res4.png?raw=true)

猫脸识别效果图一:

![4](https://github.com/CCCGX/aws-hackathon-2020/blob/master/1%20%E9%81%97%E5%A4%B1%E5%AE%A0%E7%89%A9%E7%9A%84%E6%99%BA%E8%83%BD%E5%AF%BB%E6%89%BE/%E7%8C%AB%E8%84%B8%E6%A3%80%E6%B5%8B%E5%8F%8A%E8%AF%86%E5%88%AB%20-%20Rainbow/res5.png?raw=true)

* 安装、编译指南:

1.安装代码运行所需要的环境:

python3

并使用以下命令安装dlib:

```python
pip install dlib-19.17.99-cp37-cp37m-win_amd64.whl
```
并安装其他依赖环境

```python
pip install numpy
pip install matplotlib
pip install scikit-learn
pip install opencv-python
```
3.使用juputer note打开cat1.ipynb,依次运行每个单元格进行猫脸检测

4.使用juputer note打开cat2.ipynb,依次运行每个单元格进行猫脸识别

* 团队介绍:

团队名称:Rainbow

团队成员:曹光旭

联系方式:13953006634

* 使用到的 AWS 技术:

使用SageMaker提供的GPU对模型进行训练。

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?xml version='1.0' encoding='ISO-8859-1'?>
<?xml-stylesheet type='text/xsl' href='image_metadata_stylesheet.xsl'?>
<dataset>
<name>imglab dataset</name>
<comment>Created by imglab tool.</comment>
<images>
<image file='1.jpg'>
<box top='1' left='103' width='372' height='260'/>
</image>
<image file='10.jpg'>
<box top='35' left='284' width='119' height='115'/>
</image>
<image file='2.jpg'>
<box top='23' left='180' width='221' height='200'/>
</image>
<image file='3.jpg'>
<box top='0' left='148' width='204' height='191'/>
</image>
<image file='4.jpg'>
<box top='14' left='248' width='145' height='150'/>
<box top='90' left='87' width='143' height='130'/>
</image>
<image file='5.jpg'>
<box top='23' left='19' width='115' height='102'/>
</image>
<image file='6.jpg'>
<box top='63' left='25' width='207' height='233'/>
</image>
<image file='7.jpg'>
<box top='16' left='142' width='250' height='219'/>
</image>
<image file='8.jpg'>
<box top='7' left='151' width='149' height='148'/>
</image>
<image file='9.jpg'>
<box top='18' left='161' width='109' height='108'/>
</image>
</images>
</dataset>
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method='html' version='1.0' encoding='UTF-8' indent='yes' />

<!-- ************************************************************************* -->

<xsl:variable name="max_images_displayed">30</xsl:variable>

<!-- ************************************************************************* -->

<xsl:template match="/dataset">
<html>
<head>

<style type="text/css">
div#box{
position: absolute;
border-style:solid;
border-width:1px;
border-color:red;
}

div#circle{
position: absolute;
border-style:solid;
border-width:1px;
border-color:red;
border-radius:7px;
width:1px;
height: 1px;
}

div#label{
position: absolute;
color: red;
}

div#img{
position: relative;
margin-bottom:2em;
}


pre {
color: black;
margin: 1em 0.25in;
padding: 0.5em;
background: rgb(240,240,240);
border-top: black dotted 1px;
border-left: black dotted 1px;
border-right: black solid 2px;
border-bottom: black solid 2px;
}

</style>

</head>

<body>
Dataset name: <b><xsl:value-of select='/dataset/name'/></b> <br/>
Dataset comment: <pre><xsl:value-of select='/dataset/comment'/></pre> <br/>
Number of images: <xsl:value-of select="count(images/image)"/> <br/>
Number of boxes: <xsl:value-of select="count(images/image/box)"/> <br/>
<br/>
<hr/>

<!-- Show a warning if we aren't going to show all the images -->
<xsl:if test="count(images/image) &gt; $max_images_displayed">
<h2>Only displaying the first <xsl:value-of select="$max_images_displayed"/> images.</h2>
<hr/>
</xsl:if>


<xsl:for-each select="images/image">
<!-- Don't try to display too many images. It makes your browser hang -->
<xsl:if test="position() &lt;= $max_images_displayed">
<b><xsl:value-of select="@file"/></b> (Number of boxes: <xsl:value-of select="count(box)"/>)
<div id="img">
<img src="{@file}"/>
<xsl:for-each select="box">
<div id="box" style="top: {@top}px; left: {@left}px; width: {@width}px; height: {@height}px;"></div>

<!-- If there is a label then display it in the lower right corner. -->
<xsl:if test="label">
<div id="label" style="top: {@top+@height}px; left: {@left+@width}px;">
<xsl:value-of select="label"/>
</div>
</xsl:if>

<xsl:for-each select="part">
<!--
<div id="label" style="top: {@y+7}px; left: {@x}px;">
<xsl:value-of select="@name"/>
</div>
-->
<div id="circle" style="top: {(@y)}px; left: {(@x)}px; "></div>
</xsl:for-each>
</xsl:for-each>
</div>
</xsl:if>
</xsl:for-each>
</body>
</html>
</xsl:template>

<!-- ************************************************************************* -->

</xsl:stylesheet>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading