{"id":19413209,"url":"https://github.com/generalized-intelligence/tegu","last_synced_at":"2025-10-13T00:17:14.355Z","repository":{"id":37602478,"uuid":"168091572","full_name":"generalized-intelligence/Tegu","owner":"generalized-intelligence","description":"Tegu Core. A Machine Learning Toolbox for Programmer who wants to make everything easier:)","archived":false,"fork":false,"pushed_at":"2022-11-22T01:58:49.000Z","size":20486,"stargazers_count":11,"open_issues_count":14,"forks_count":4,"subscribers_count":6,"default_branch":"master","last_synced_at":"2023-03-05T10:39:09.539Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.gaas.dev","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/generalized-intelligence.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-29T04:55:25.000Z","updated_at":"2022-04-12T02:47:27.000Z","dependencies_parsed_at":"2023-01-21T12:49:08.521Z","dependency_job_id":null,"html_url":"https://github.com/generalized-intelligence/Tegu","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/generalized-intelligence%2FTegu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/generalized-intelligence%2FTegu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/generalized-intelligence%2FTegu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/generalized-intelligence%2FTegu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/generalized-intelligence","download_url":"https://codeload.github.com/generalized-intelligence/Tegu/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223952660,"owners_count":17230928,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T12:31:34.362Z","updated_at":"2025-10-13T00:17:09.330Z","avatar_url":"https://github.com/generalized-intelligence.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Tegu Logo](https://s2.ax1x.com/2019/01/30/kl6rzF.jpg)\n# Tegu\n\n[![Join the chat at https://gitter.im/Tegutalk/community](https://badges.gitter.im/Tegutalk/community.svg)](https://gitter.im/Tegutalk/community?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\n## Use Machine Learning Right Now In Your Project\n## 即刻在你的项目中使用机器学习\n\nTegu-core is the core component of Tegu, which provides an encapsulation of some state-of-the-art deep learning models of computer vision, and its APIs are called by the Tegu GUI components. You can use Tegu-core to provide some deep learning functions in your own Python projects with only a few codes.\n\nTegu-core 是 Tegu 的核心组件，提供了对一些当前最佳实践（State of the Art）的计算机视觉深度学习模型的封装，与Tegu GUI配合使用。若您需要在Python项目中引入深度学习功能，只需要很少的代码，您就可以将Tegu-core与您的项目一起配合使用。\n\n---\n\n## 30s to start training car detection model\nFor deep learning tasks, Tegu uses the **Network_Model** class to manage training tasks, and uses the **Network_Dataloader** class to manage data sets.\n\n1. Download [car detection dataset](https://fanhuaai-my.sharepoint.cn/:u:/g/personal/dongshuo_giai_tech/EYzwu6k3GMVDlcrlhe3R6WIBOqcBr5t_eTeX3Uz5uO-0sQ?e=vVkmXf) and unzip, the dataset contains:\n```cmd\n|CarDataset/\n    |--trainset/  #Images to train the model.\n        |--xxx.jpg\n        ...\n    |--testset/  #Images to test your model.\n        |--xxx.jpg\n        ...\n    |car_annotation.serval  #The annotation file contains the annotations for the images in the trainset directory.\n```\n2. First import the API library of the SSD300 image detection model.\n```python\nfrom Network.SSD300.API import SSD_Model, SSD_DataLoader\n```\n3. Create **SSD_Model** and **SSD_Dataloader** instances.\n```python\nm = SSD_Model(class_count=2, base_lr=0.0004)\nd = SSD_DataLoader(anno_path=r\"dataset/save/path/car_annotation.serval\", data_path=r\"dataset/save/path/trainset\",batch_size=16)\n```\n4. Set the Dataset for **SSD_Model**.\n```python\nm.set_dataset(d)\n```\n5. Start training, set the epoch to 100 rounds, and save every 20 rounds.\n```python\nepoch = 100\nfor i in range(epoch):\n    train_info = m.train()\n    print(train_info)   #{'loss':[3.3914230046448886], 'val_loss':[3.8560243606567384]}\n    if (i+1)%20==0 or i+1==epoch:\n        save_path = \"ssd_model{}.h5\".format(str(i).zfill(3))\n        m.model.save(save_path)\n```\n6. After training, use Tegu-core to predict image. First create **SSD_Model** .\n```python\nm = SSD_Model(class_count=2)\n```\n7. Start predicting image using the model trained in the first few step.\n```python\nm.predict(img_path=r\"dataset/save/path/trainset/xxx.jpg\", model_path=r\"ssd_modelXXX.h5\", anno_path=r\"dataset/save/path/car_annotation.serval\")\n#[[label:int, class_name:str, score:double, (xmin, ymin), (xmax, ymax)]]\n```\nFor more usage, see `Example`.\n\n## Quick Start\n\n1. Install [Python3](https://www.python.org) and [pip3](https://pip.pypa.io/en/stable/installing)\n2. Install [CUDA](https://developer.nvidia.com/cuda-downloads) and [cuDNN](https://developer.nvidia.com/cudnn)\n3. If you would like to use the Facial Recognition feature, please compile and install [OpenCV](https://opencv.org/). Please make sure the DNN module is installed.\n4. Use the following command to install requirements:\n\n```sh\npip3 install -r requirements.txt\n```\n\n5. For the usage of Tegu-core API, see `Example` Folder.\n\nFor Image Recognition and Video Classification, we have developed a set of tools to process and clean up the datasets. You may use [Tegu Image Annotation](http://www.giai.tech) and [Tegu Video Annotation](http://www.giai.tech) to process your dataset.\n\n## File Structure\n\n* Network/: Neural Networks, called by scripts in GUI/\n* Example/: Samples for how to use Tegu-core. \n* Util/: Utility used in the project\n\n## Existing Features\n\n* Video Classification (Long Video Classification)\n* Image Recognition\n* Facial Recognition (build feature library, and recognize)\n* License Plate Recognition\n\nHTTP API is available for Image Recognition, Facial Recognition and License Plate Recognition\n\n## Relevant Projects\n\nFor Image Recognition and Video Classification, we have developed a set of tools to process and clean up the datasets. You may use [Tegu Image Annotation](http://www.giai.tech) and [Tegu Video Annotation](http://www.giai.tech) to process your dataset.\n\n## Existing Neural Networks\n\n* [YOLOv3](https://github.com/qqwweee/keras-yolo3)\n* [SSD300](https://github.com/pierluigiferrari/ssd_keras)\n* [ActivityNet](https://github.com/imatge-upc/activitynet-2016-cvprw)\n* [MTCNN_face_detection](https://github.com/kpzhang93/MTCNN_face_detection_alignment)\n* [facenet](https://github.com/davidsandberg/facenet)\n\n## TODO\n\n* Optimization of interprocess communication\n* Adding common neural networks, such as passenger detection, vehicle detection, and cat/dog detection\n* Abnormality Detection in Restricted Zone (Training Free)\n* Hand Gesture Recognition, Pose Detection based on Feature Point Paring, Facial Feature Point Detection (Training Free)\n* Image Segmentation\n* General OCR\n* Video Tracking (Work-In-Progress)\n\n# Meta\n\nProject initialized by Generalized Intelligence\nDistributed under the BSD 3-Clause license. See LICENSE for more information.\n\n# Contribute\n\nPlease follow CONTRIBUTING.md\n\n---\n\n## 30秒开始训练车辆检测模型\n对于深度学习任务，Tegu 使用 **网络名_Model** 类来管理训练任务，使用 **网络名_Dataloader** 类来管理数据集。\n\n1. 下载 [车辆检测数据集](https://fanhuaai-my.sharepoint.cn/:u:/g/personal/dongshuo_giai_tech/EYzwu6k3GMVDlcrlhe3R6WIBOqcBr5t_eTeX3Uz5uO-0sQ?e=vVkmXf) 并解压缩。\n```cmd\n|CarDataset/\n    |--trainset/  #Images to train the model.\n        |--xxx.jpg\n        ...\n    |--testset/  #Images to test your model.\n        |--xxx.jpg\n        ...\n    |car_annotation.serval  #The annotation file contains the annotations for the images in the trainset directory.\n```\n2. 首先 import SSD300 图像检测模型的 API 库。\n```python\nfrom Network.SSD300.API import SSD_Model, SSD_DataLoader\n```\n3. 创建 **SSD_Model** 和 **SSD_Dataloader** 实例。\n```python\nm = SSD_Model(class_count=2, base_lr=0.0004)\nd = SSD_DataLoader(anno_path=r\"dataset/save/path/car_annotation.serval\", data_path=r\"dataset/save/path/trainset\",batch_size=16)\n```\n4. 为 **SSD_Model** 设置 Dataset。\n```python\nm.set_dataset(d)\n```\n5. 开始训练，设置 epoch 为 100 轮，并且每 20 轮保存一次。\n```python\nepoch = 100\nfor i in range(epoch):\n    train_info = m.train()\n    print(train_info)   #{'loss':[3.3914230046448886],'val_loss':[3.8560243606567384]}\n    if (i+1)%20==0 or i+1==epoch:\n        save_path = \"ssd_model{}.h5\".format(str(i).zfill(3))\n        m.model.save(save_path)\n```\n6. 完成训练以后，使用 Tegu-core 预测图片。首先创建 **SSD_Model** 实例。\n```python\nm = SSD_Model(class_count=2)\n```\n7. 使用前几步训练出的模型预测图片\n```python\nm.predict(img_path=r\"dataset/save/path/trainset/xxx.jpg\", model_path=r\"ssd_modelXXX.h5\", anno_path=r\"dataset/save/path/car_annotation.serval\")\n#[[label:int, class_name:str, score:double, (xmin, ymin), (xmax, ymax)]]\n```\n查看更多应用，请参见 `Example`。\n\n## 快速开始\n1. 首先请安装 [Python3](https://www.python.org) 以及 [pip3](https://pip.pypa.io/en/stable/installing)。\n2. 请安装 [CUDA](https://developer.nvidia.com/cuda-downloads) 和 [cuDNN](https://developer.nvidia.com/cudnn)。\n3. 如果需要使用人脸检测功能， 请编译安装 [OpenCV](https://opencv.org/), 并确保安装其 DNN 模块。\n4. 使用如下命令安装所需的 Python 框架:\n\n```sh\npip3 install -r requirements.txt\n```\n5. Tegu-core 模型API的用法，可以参照`Example`文件夹中的示例代码。\n\n对于图像检测和视频分类任务，我们使用自己的格式处理数据集，您可以使用 [Tegu 图像标注软件](http://www.giai.tech)，和 [Tegu 视频标注软件](http://www.giai.tech) 来制作数据集。\n\n## 文件结构\n\n* Network/: 项目所用到的网络部分，可供外部的Python文件调用。\n* Example/：项目的示例代码。\n* Util/: 项目使用的一些工具脚本。\n\n## 现有功能\n\n* 视频分类（长视频分类）\n* 图像检测\n* 人脸识别（建立特征库，并识别人脸）\n* 车牌识别\n\n## 相关项目\n\n对于图像检测和视频分类的数据处理及标注，我们提供了 [Tegu 图像标注软件](http://www.giai.tech)，和 [Tegu 视频标注软件](http://www.giai.tech) \n\n## 已有网络\n\n* [YOLOv3](https://github.com/qqwweee/keras-yolo3)\n* [SSD300](https://github.com/pierluigiferrari/ssd_keras)\n* [ActivityNet](https://github.com/imatge-upc/activitynet-2016-cvprw)\n* [MTCNN_face_detection](https://github.com/kpzhang93/MTCNN_face_detection_alignment)\n* [facenet](https://github.com/davidsandberg/facenet)\n\n## 待办事项\n\n* 修改进程通信模块\n* 建立行人，车辆，猫狗等常见检测模型\n* 禁入区等功能（免训练）\n* 手势识别，人体姿态特征点检测，人脸特征点检测（免训练）\n* 图像分割，要有相应的常见模型\n* 通用OCR。\n* 视频追踪（Work-In-Progress）\n\n# 版权信息\n\n泛化智能 Generalized Intelligence 出品。\n本项目通过 BSD 3-Clause 协议发布，详情见 LICENSE。 \n\n# 贡献\n\n请参阅 CONTRIBUTING.md\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeneralized-intelligence%2Ftegu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeneralized-intelligence%2Ftegu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeneralized-intelligence%2Ftegu/lists"}