from QTUI.MainWindow import Ui_FIITM
from QTUI.Dialog import Ui_Dialog
from FaceMaskDetection_Class import FaceMaskDetector
from Cameras_Class import Cameras
from TemperatureCalculator_Class import TemCalculator
import utils
import sys
from PyQt5.QtWidgets import QApplication, QMainWindow, QFileDialog, QDialog
from PyQt5.QtCore import QTimer, QCoreApplication, Qt
from PyQt5.QtGui import QPixmap
import cv2
import numpy as np
import qimage2ndarray
from datetime import datetime
import webbrowser as browser
import os
class FIITM_MAIN(QMainWindow,Ui_FIITM):
def __init__(self,parent=None):
super(FIITM_MAIN, self).__init__(parent)
self.setupUi(self) # son of Ui_Form\setupUi
# instantiate objects
self.Cameras = Cameras()
# function initiations
self.Timer = QTimer() # Timer
self.Parameters_Initiation() # Initiate Parameters
self.Widget_Initiation() # Initiate Widgets
self.Call_BackgroundFuns() # Call Background Functions
self.Timer.timeout.connect(self.Run) # Call Video Each 1ms
def Parameters_Initiation(self):
# MainWindow
self.SaveVideoFlag = False
self.SaveFrameFlag = False
self.DispDCVideoFlag = False
self.DispICVideoFlag = False
self.AutoSaveFramesFlag = False
self.InputMode = "Cameras"
self.LastTime = datetime.now()
# Parameters of Dialog Window
self.AlarmTem = 37.2
self.FaceDetectionConf = 0.6
self.FaceDetectionIOU = 0.3
self.DistanceCorr_Flag = 0
self.GestureCorr_Flag = 0
self.SavePath = "./Files/"
self.AutosaveFrenquency = 5
self.CalculateFrenquency = 10
# Check Status
self.Log = "Start Application at "+ datetime.strftime(datetime.now(),'%Y-%m-%d %H:%M:%S')+"\nChecking Cameras ...\n"
self.Loglines = -2
if self.Cameras.DCCamera.status == False:
self.Log += "Warning: Wrong with Digital Camera\n"
self.Loglines += 1
self.InputMode = "Videos"
if self.Cameras.IRCamera.status == False:
self.Log += "Warning: Wrong with Infrared Camera\n"
self.Loglines += 1
self.InputMode = "Videos"
if not os.path.exists("./__model/anchors_exp.csv"):
self.Log += "Error: Can Not Open ./__model/anchors_exp.csv\n"
self.Loglines += 1
self.Save_Log
QCoreApplication.quit()
if not (os.path.exists("./__model/face_mask_detection.pth") and os.path.exists("./__model/MainModel.py")):
self.Log += "Error: Require a Face Detection Model, check ./__model/face_mask_detection.pth and ./__model/MainModel.py\n"
self.Loglines += 1
self.Save_Log
QCoreApplication.quit()
if not os.path.exists("./Files"):
os.mkdir("Files")
# Others
self.Frame_Num = 0
self.Video_Num = 0
self.DCFrame = np.ones((3,480,640),dtype=np.uint8)
self.ICFrame = np.ones((480,640),dtype=np.uint8)
self.DC_VideoReader = cv2.VideoCapture(self.Cameras.DCCamera.DC_ID)
self.IC_VideoReader = cv2.VideoCapture(self.Cameras.IRCamera.IC_ID)
self.Github_url = "https://baidu.com"
self.HelpDoc_url = os.path.abspath("./__model/Help.pdf")
self.Log += "Initiation Done.\n"
self.Loglines += 1
self.LogOut_Window.setPlainText(self.Log)
self.LogOut_Window.verticalScrollBar().setSliderPosition(self.Loglines)
self.ICVideoRVAL = 0
self.DCVideoRVAL = 0
def Widget_Initiation(self):
# Start Timer
self.Timer.start(1000)
# Menus and actions(3 + 9)
self.menuFile.setEnabled(True)
self.menuSettings.setEnabled(True)
self.menuHelp.setEnabled(True)
self.actionOpen_DCPicture.setEnabled(False)
self.actionOpen_ICPicture.setEnabled(False)
self.actionOpen_DCVideo.setEnabled(False)
self.actionOpen_ICVideo.setEnabled(False)
self.actionSave_Log.setEnabled(True)
self.actionSave_Settings.setEnabled(True)
self.actionVisit_Homepage_On_Github.setEnabled(True)
self.actionHelp_Document.setEnabled(True)
self.actionCopyright.setEnabled(True)
# Buttons(9)
self.RunDC_BT.setEnabled(True)
self.RunIC_BT.setEnabled(True)
self.PauseDC_BT.setEnabled(False)
self.PauseIC_BT.setEnabled(False)
self.SaveVideoStart_BT.setEnabled(False)
self.SaveVideoStop_BT.setEnabled(False)
self.AutosaveFramesStart_BT.setEnabled(False)
self.AutosaveFramesStop_BT.setEnabled(False)
self.SaveFrame_BT.setEnabled(False)
# Radio Buttons(3)
if (self.Cameras.DCCamera.status and self.Cameras.IRCamera.status):
self.InputModeCameras_RBT.setChecked(True)
self.InputModeVideos_RBT.setChecked(False)
self.InputModePictures_RBT.setChecked(False)
else:
self.InputModeCameras_RBT.setChecked(False)
self.InputModeVideos_RBT.setChecked(True)
self.InputModeVideos_RBT_Clicked
self.InputModePictures_RBT.setChecked(False)
self.InputModeCameras_RBT.setCheckable(False)
self.actionOpen_DCVideo.setEnabled(True)
self.actionOpen_ICVideo.setEnabled(True)
# Texts(3)
self.DC_Window.setEnabled(True)
self.IC_Window.setEnabled(True)
self.LogOut_Window.setReadOnly(True)
self.LogOut_Window.setOverwriteMode(True)
self.LogOut_Window.verticalScrollBar().setSliderPosition(self.Loglines)
def Call_BackgroundFuns(self):
# Buttons(9)
self.RunDC_BT.clicked.connect(self.RunDC_BT_Clicked)
self.RunIC_BT.clicked.connect(self.RunIC_BT_Clicked)
self.PauseDC_BT.clicked.connect(self.PauseDC_BT_Clicked)
self.PauseIC_BT.clicked.connect(self.PauseIC_BT_Clicked)
self.SaveVideoStart_BT.clicked.connect(self.SaveVideoStart_BT_Clicked)
self.SaveVideoStop_BT.clicked.connect(self.SaveVideoStop_BT_Clicked)
self.AutosaveFramesStart_BT.clicked.connect(self.AutosaveFramesStart_BT_Clicked)
self.AutosaveFramesStop_BT.clicked.connect(self.AutosaveFramesStop_BT_Clicked)
self.SaveFrame_BT.clicked.connect(self.SaveFrame_BT_Clicked)
self.Exit_BT.clicked.connect(self.EXIT)
# Radio Buttons(2)
self.InputModeCameras_RBT.clicked.connect(self.InputModeCameras_RBT_Clicked)
self.InputModeVideos_RBT.clicked.connect(self.InputModeVideos_RBT_Clicked)
self.InputModePictures_RBT.clicked.connect(self.InputModePictures_RBT_Clicked)
# Menu- QActions(9)
self.actionSettings.triggered.connect(self.Call_DiaogWindow)
self.actionHelp_Document_Parameters.triggered.connect(self.Parameters_Explain)
self.actionOpen_DCPicture.triggered.connect(self.Open_DCPicture)
self.actionOpen_ICPicture.triggered.connect(self.Open_ICPicture)
self.actionOpen_DCVideo.triggered.connect(self.Open_DCVideo)
self.actionOpen_ICVideo.triggered.connect(self.Open_ICVideo)
self.actionSave_Log.triggered.connect(self.Save_Log)
self.actionSave_Settings.triggered.connect(self.Save_Settings)
self.actionVisit_Homepage_On_Github.triggered.connect(self.Visit_Homepage_On_Github)
self.actionHelp_Document.triggered.connect(self.Help_Document)
self.actionCopyright.triggered.connect(self.Copyright)
def EXIT(self):
QCoreApplication.quit()
def Call_DiaogWindow(self):
self.Log += "Parameter Settings\n {\n"
self.Loglines += 2
self.DialogWindow = FIITM_DIALOG()
print(self.AlarmTem)
self.DialogWindow.Parameters_Initiation(
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
基于红外相机和人脸检测的体温监测告警系统python源码.zip 【资源介绍】 基于红外相机和人脸检测的体温监测告警系统,主要功能特点如下 1. 面向车站等大人流等应用场合进行动态体温检测; 2. 基于红外相机的温度读取和体温提取分析 3. 结合人脸识别进行距离影响修正、人脸姿态影响修正;提高温度计算域提取准确度; 4. 基于OpenCV视频处理,实时动态显示体温 5. 基于PyQT开发UI,支持摄像头实时读取处理、本地视频、图片的读取分析及显示;支持系统识别的关键参数设置;支持(自动)保存当前帧、保存视频等文件保存操作; 6. 支持设置告警体温以实现体温超标自动告警 7. 通过Pyinstaller生成.exe可执行文件,支持视频分析、图像分析等本地连接;改变相机参数可以进行实时监测
资源推荐
资源详情
资源评论
收起资源包目录
基于红外相机和人脸检测的体温监测告警系统python源码.zip (22个子文件)
项目说明.md 813B
codes
utils.py 3KB
Cameras_Class.py 1KB
TemperatureCalculator_Class.py 692B
FIITM.py 36KB
FaceMaskDetection_Class.py 6KB
TemperatureCalculator_Class_1.py 2KB
QTUI
Dialog1.py 8KB
FIITM.ui 30KB
Dialog.py 8KB
MainWindow.py 23KB
__pycache__
Dialog.cpython-37.pyc 5KB
MainWindow.cpython-37.pyc 10KB
MainWindow1.py 23KB
Dialog.ui 10KB
__model
MainModel.py 17KB
face_mask_detection.pth 3.92MB
__pycache__
MainModel.cpython-37.pyc 8KB
anchors_exp.csv 590KB
UIDemo-1.jpg 194KB
Images
UIDemo.jpg 194KB
Demo-2.png 1.18MB
共 22 条
- 1
资源评论
manylinux
- 粉丝: 4423
- 资源: 2491
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功