Python+Django人脸识别考勤系统网站

简介: 这篇博客针对<<Python+Django人脸识别考勤系统网站>>编写代码,代码整洁,规则,易读。 学习与应用推荐首选。

程序示例精选

Python+Django人脸识别考勤系统网站

如需安装运行环境或远程调试,可点击右边主头像昵称进入个人主页查看博主联系方式,由专业技术人员远程协助!

前言

这篇博客针对<<Python+Django人脸识别考勤系统网站>>编写代码,代码整洁,规则,易读。 学习与应用推荐首选。


文章目录

一、所需工具软件

二、使用步骤

       1. 引入库

       2. 代码实现

       3. 运行结果

三、在线协助

一、所需工具软件

1. Python,Pycharm

2. Django

二、使用步骤

1.引入库

<html>
<head>
<meta charset="utf-8">
<meta content="width=device-width,user-scalable=no" name="viewport">
<title>login</title>
<style type="text/css">
    #box4{
        background-color: #5ACCC9;
        width: 500px;
        height: 50px;
        margin:auto ;
        float: left;
        position:absolute;
        top: -290;
        left: 0;
        right: 0;
        bottom: 0;
        border-style:none;
        border-radius: 5px;
    }
    #box1{
        background-color: #8C7EF3;
        width: 500px;
        height: 300px;
        margin:auto ;
        float: inline;
        position:relative;
        top: 10px;
        left: 0;
        right: 0;
        bottom: 0;
        border-style:none;
        border-radius: 5px;
    }
    .p1{
        color: black;
        font-size: 20px;
        margin-left:20px;
        margin-top: 25px;
        font-family: microsoft yahei;
        font-weight: normal;
        text-align: left;
        line-height:23px;
        position: center;
    }
    #box2{
        background-color: #8C7EF3;
        width: 120px;
        height: 250px;
        margin-top:20px;
        margin-left:70px;
        float: left;
        text-align: center;
        position:static;
    }
    #box3{
        background-color: #8C7EF3;
        width: 230px;
        height: 250px;
        margin-top:20px;
        float: left;
        text-align: center;
        position:static;
    }
    #input0{
        width: 200px;
        height: 30px;
        margin-top:20px;
    }
    #input1{
        width: 100px;
        height: 50px;
        margin: 20px;
        font-family: microsoft yahei;
        font-weight: normal;
        font-size: 16px;
    }
    #input2{
        width: 130px;
        height: 50px;
        margin: 0px;
        font-family: microsoft yahei;
        font-weight: normal;
        font-size: 16px;
        float: left;
        border-width: 0px;
        border-radius: 3px;
    }
    #pgheader1{
        background: rgb(51,51,51);
        width: 100%;
        min-width: 960px;
        height: 35px;
        margin: 0px auto;
        width: 100%;
        position: relative;z-index:5;
        border-color: rgb(255, 255, 255);
        border-width: 0px;
        border-style: solid;
        }
    #pgheader2{
        padding-top: 10px;
        padding-right: 0px;
        display: inline-block;
        z-index: 1000;
        color: rgb(255,255,255);
        font-size:15px;
    }
</style>
</head>

image.gif

2. 代码实现

代码如下:

<body style="background-color: #5ACCC9;">
    <div class="rowright" >
        <a class="box" href="/accounts/logout/">注销</a>
        <a class="box" href="/accounts/login/">登录</a>
    </div>
    <div  style="width:100%;text-align: center;">
            <DIV ID="pgheader1";><a ID="pgheader2" >XXX管理网站</a></DIV>
            <div>
                <h1 style="font-family:'Microsoft YaHei';font-size:30px";>人脸识别考勤管理系统</h1>
            </div>
    </div>
    <div class="row">
        <div class="row">
            <!-- Add id to image -->
            <div class="box" style="background-color: #896bda;height:400px;">
                <img id="image" src="" alt="" width="300" height="300"/>
            </div>
            <!-- 按钮1 -->
<!--            <div class="box" >-->
<!--                <button type="button" onclick="show()" id="input1">打开视频窗口</button>-->
<!--            </div>-->
        </div>
        <div class="row">
            <div class="container">
                <!--修改文章 -->
                <form style="margin-top: 7.2px;width: 250px;height: 370px" action="" method="post" enctype="multipart/form-data">
                    {% csrf_token %}
                    <div align="center">
                        <div ><label>编号:</label><input type="text" name="idnumberWeb" ></div>
                        <div><label>英文名:</label><input type="text" name="nameWeb" ></div>
                        <div><label>中文名:</label><input type="text" name="chinese_nameWeb" ></div>
                    </div>
                    <select name="app" style="width:100px;height:43px;">
                        <option value="selectItem" style="text-align: center; ">选择功能</option>
                        <option value="gatherF" style="text-align: center; ">gatherF</option>
                    </select>
                    <input type="submit" value="&nbsp&nbsp录入人脸&nbsp&nbsp">
                </form>
                <!--修改文章结束 -->
            </div>
            <div>
                <div class="container" style="text-align: center; " >
                    <!--显示文章 -->
                    <form style="margin-top: 10px;width: 150px" action="" method="post" enctype="multipart/form-data">
                        {% csrf_token %}
                        <input type="text" name="itemWeb" hidden value="initM">
                        <input type="submit" value="初始化模型">
                    </form>
                    <!--显示文章结束 -->
                </div>
                <div class="container" style="text-align: center; " >
                    <!--显示文章 -->
                    <form style="margin-top: 10px;width: 150px" action="" method="post" enctype="multipart/form-data">
                        {% csrf_token %}
                        <input type="text" name="itemWeb" hidden value="stopM">
                        <input type="submit" value="&nbsp&nbsp停止模型&nbsp&nbsp">
                    </form>
                    <!--显示文章结束 -->
                </div>
                <div class="container" style="text-align: center;">
                    <!--显示文章 -->
                    <form style="margin-top: 10px;width: 150px;" action="" method="post" enctype="multipart/form-data">
                        {% csrf_token %}
                        <input type="text" name="idnumberCourseWeb" value="输入课程编号" style="width:120px;"><br>
                        <input type="text" name="itemWeb" hidden value="recognF">
                        <input type="submit"  value="&nbsp&nbsp识别人脸&nbsp&nbsp">
                    </form>
                    <!--显示文章结束 -->
                </div>
                <div class="container" style="text-align: center; ">
                    <!--显示文章 -->
                    <form style="margin-top: 10px;width: 150px" action="" method="post" enctype="multipart/form-data">
                        {% csrf_token %}
                        <input type="text" name="itemWeb" hidden value="trainF">
                        <input type="submit" value="&nbsp&nbsp训练人脸&nbsp&nbsp">
                    </form>
                    <!--显示文章结束 -->
                </div>
            </div>
        </div>
    </div>
    <div id="divT" style="background-color: #0d95e8;width: 835px;height: 100px;border-radius: 5px;margin: 20px auto;font-size: 36px;font-family: 'Microsoft YaHei'; display: flex;align-items: center;justify-content: center; "></div>
<!--    <div class="row">-->
<!--        <form action="" method="post" enctype="multipart/form-data" style="background-color: #86cfda;height:120px;width: 790px;display: flex;">-->
<!--            {% csrf_token %}-->
<!--            <div class="box" style="background-color: #896bda;height:100px;width: 900px;display: inline-block;">-->
<!--                <input type="text" name="checkCoursePlan" hidden value="checkCoursePlan">-->
<!--                <input type="text" id="showPlan"  style="height: 90px">-->
<!--            </div>-->
<!--            <div class="box"  style="width: 180px">-->
<!--                <input type="submit" value="查看课程计划" id="input1" style=";width:150px ">-->
<!--            </div>-->
<!--        </form>-->
<!--    </div>-->
<style>
  table {
    width: 100%;
    max-width: 830px;
    border-collapse: collapse;
  }
  th, td {
    padding: 0.5em 1em;
    text-align: center;
    border: 1px solid #ccc;
  }
  th {
    background-color: #eee;
    font-weight: bold;
    text-align: center;
  }
</style>
<div style="width: 100%; display: flex; justify-content: center;">
  <table style="margin: auto;">
    <thead>
      <tr>
        <th>课程编号</th>
        <th>名称</th>
        <th>教师姓名</th>
        <th>开始时间</th>
        <th>结束时间</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        {% for field in BookRoomT %}
            <tr>
                <td>{{ field.id }}</a></td>
                <td>{{ field.course }}</td>
                <td>{{ field.chinese_name }}</td>
                <td>{{ field.start_time }}</td>
                <td>{{ field.close_time }}</td>
            </tr>
        {% endfor %}
      </tr>
    </tbody>
  </table>
</div>
{% if messages %}
<script>
    {% for msg in messages %}
        alert('{{ msg.message }}');
    {% endfor %}
</script>
{% endif %}
<script type="text/javascript">
    var gatherT = "{{gatherT}}"
    const intervalId = setInterval(function() {
        console.log("gatherT:",gatherT)
        if (gatherT === "采集结束") {
            var image = document.getElementById("divT");
            divT.innerHTML = "采集结束";
            clearInterval(intervalId);
        }
    }, 1000);
</script>
<script type="text/javascript">
    var trainT = "{{trainT}}"
    const intervalId2 = setInterval(function() {
        console.log("trainT:",trainT)
        if (trainT === "训练结束") {
            var image = document.getElementById("divT");
            divT.innerHTML = "训练结束";
            clearInterval(intervalId2);
        }
    }, 1000);
</script>
<script type="text/javascript">
    var stringT2 = "{{stringT2}}"
    var chinese_name = "{{chinese_nameT}}"
    var idnumberNum = "{{idnumberNumT}}"
    const intervalId3 = setInterval(function() {
        console.log("stringT2:",stringT2)
        if (stringT2 === "识别成功") {
            var image = document.getElementById("divT");
            divT.innerHTML = "姓名:" + chinese_name + "编号:"+ idnumberNum + "  "+"识别成功";
            clearInterval(intervalId3);
        }
    }, 1000);
</script>
<!--<script>-->
<!--    var coursePlanT = "{{coursePlanT}}"-->
<!--    setInterval(function() {-->
<!--        // var stringT1 = "{{stringT1}}"-->
<!--        console.log("coursePlanT:",coursePlanT)-->
<!--        var showPlanT = document.getElementById("showPlan");-->
<!--        showPlanT.value +=coursePlanT;-->
<!--    }, 1000);-->
<!--</script>-->
</body>
</html>

image.gif

3. 运行结果

image.gif编辑

image.gif


三、在线协助:

如需安装运行环境或远程调试, 可点击右边 主头像 昵称 进入个人主页查看博主联系方式 ,由专业技术人员远程协助!
1)远程安装运行环境,代码调试
2)Qt, C++, Python入门指导
3)界面美化
4)软件制作


博主推荐文章:python人脸识别统计人数qt窗体-CSDN博客

博主推荐文章:Python Yolov5火焰烟雾识别源码分享-CSDN博客

                        Python OpenCV识别行人入口进出人数统计_python识别人数-CSDN博客

个人博客主页:alicema1111的博客_CSDN博客-Python,C++,网页领域博主

博主所有文章点这里:alicema1111的博客_CSDN博客-Python,C++,网页领域博主


相关文章
|
3天前
|
机器学习/深度学习 Ubuntu 数据挖掘
Ubuntu系统部署Anaconda环境及Python语言的详细流程
以上就是在Ubuntu系统中安装Anaconda环境及Python语言的详细流程。Anaconda为Python科学计算提供了便捷的管理方式,帮助用户轻松处理不同项目之间依赖管理的复杂性。通过以上步骤,你现在应该有了一个完全可用的Anaconda环境,可以开始在Ubuntu上进行Python编程和数据科学项目的探索了。
13 5
|
5天前
|
运维 Devops 测试技术
一个人活成一个团队:python的django项目devops实战
DevOps通过自动化的流程,使得构建、测试、发布软件能够更加地快捷、频繁和可靠。本文通过一个python的django个人博客应用进行了DevOps的实战,通过DevOps拉通开发和运维,通过应用云效的DevOps平台实现自动化“软件交付”的流程,使得构建、测试、发布软件能够更加地快捷、频繁和可靠,提交研发交付效率。作为个人项目也是可以应用devops提高效率。
18 3
|
1天前
|
机器学习/深度学习 Ubuntu 数据挖掘
揭秘:Ubuntu系统下部署Anaconda环境及Python语言的终极指南!跟随这一步步神秘流程,解锁编程大师的秘密武器!
【8月更文挑战第19天】在Ubuntu中部署Anaconda环境与Python相当直观。首先需从官网下载Linux版安装包。接着,在终端依次执行命令:添加Anaconda清华镜像源至软件源列表,更新软件包信息,然后安装Anaconda。安装后可通过`anaconda --version`验证。使用`anaconda create -n myenv python=3.8`创建名为“myenv”的环境并指定Python 3.8版本。
|
4天前
|
SQL 前端开发 关系型数据库
Python之Web框架Django
Python之Web框架Django
8 0
|
5天前
|
设计模式 API Python
Python Web:Django、Flask和FastAPI框架对比
Python Web:Django、Flask和FastAPI框架对比
13 0
|
3月前
|
弹性计算 Java PHP
新手用户注册阿里云账号、实名认证、购买云服务器图文教程参考
对于初次购买阿里云产品的用户来说,第一步要做的是注册账号并完成实名认证,然后才是购买阿里云服务器或者其他云产品,本文为大家以图文形式展示一下新手用户从注册阿里云账号、实名认证到购买云服务器完整详细教程,以供参考。
新手用户注册阿里云账号、实名认证、购买云服务器图文教程参考
|
2月前
|
文字识别 算法 API
视觉智能开放平台产品使用合集之uniapp框架如何使用阿里云金融级人脸识别
视觉智能开放平台是指提供一系列基于视觉识别技术的API和服务的平台,这些服务通常包括图像识别、人脸识别、物体检测、文字识别、场景理解等。企业或开发者可以通过调用这些API,快速将视觉智能功能集成到自己的应用或服务中,而无需从零开始研发相关算法和技术。以下是一些常见的视觉智能开放平台产品及其应用场景的概览。
|
12月前
|
机器学习/深度学习 搜索推荐 计算机视觉
【阿里云OpenVI-人脸感知理解系列之人脸识别】基于Transformer的人脸识别新框架TransFace ICCV-2023论文深入解读
本文介绍 阿里云开放视觉智能团队 被计算机视觉顶级国际会议ICCV 2023接收的论文 &quot;TransFace: Calibrating Transformer Training for Face Recognition from a Data-Centric Perspective&quot;。TransFace旨在探索ViT在人脸识别任务上表现不佳的原因,并从data-centric的角度去提升ViT在人脸识别任务上的性能。
2004 341
|
3月前
对于阿里云OpenAPI的域名实名认证
【1月更文挑战第5天】【1月更文挑战第22篇】对于阿里云OpenAPI的域名实名认证
55 1