MIT License

项目介绍

Ahmednull/L2CS-Net 是一个托管在 GitHub 上的开源项目,主要使用 Python 编写,采用 MIT License 许可证,目前获得 540 个 Star、113 次 Fork。

仓库全名
Ahmednull/L2CS-Net
开源许可证
MIT License
Star 数
540
Fork 数
113
未关闭 Issue
23

README 摘要

L2CS-Net The official PyTorch implementation of L2CS-Net for gaze estimation and tracking. Installation Install package with the following: Or, you can git clone the repo and install with the following: Now you should be able to import the package with the following command: Usage Detect face and predict gaze from webcam Demo Download the pre-trained models from here and Store it to models/. Run: This means the demo…

完整内容见 GitHub 原始 README 或本页 。

常见问题

L2CS-Net 用什么语言开发?

主要使用 Python 编写,采用 MIT License 许可证,目前有 540 个 Star。

L2CS-Net 可以免费商用吗?

仓库采用 MIT License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 L2CS-Net 的源码?

可以直接克隆仓库:git clone https://github.com/Ahmednull/L2CS-Net.git,默认分支为 main;安装与运行步骤见仓库 README。

L2CS-Net 最近还在维护吗?

仓库最近一次更新为 2024年2月3日,当前有 23 个未关闭 Issue;Star 数为 540,可作为社区活跃度的参考。

关于

The official PyTorch implementation of L2CS-Net for gaze estimation and tracking

描述取自 GitHub 官方 API,中文内容由 GitRead 中文社区 编辑团队整理。

README

animated


L2CS-Net

The official PyTorch implementation of L2CS-Net for gaze estimation and tracking.

Installation

Install package with the following:

pip install git+https://github.com/edavalosanaya/L2CS-Net.git@main

Or, you can git clone the repo and install with the following:

pip install [-e] .

Now you should be able to import the package with the following command:

$ python
>>> import l2cs

Usage

Detect face and predict gaze from webcam

from l2cs import Pipeline, render
import cv2

gaze_pipeline = Pipeline(
    weights=CWD / 'models' / 'L2CSNet_gaze360.pkl',
    arch='ResNet50',
    device=torch.device('cpu') # or 'gpu'
)
 
cap = cv2.VideoCapture(cam)
_, frame = cap.read()    

# Process frame and visualize
results = gaze_pipeline.step(frame)
frame = render(frame, results)

Demo

  • Download the pre-trained models from here and Store it to models/.
  • Run:
 python demo.py \
 --snapshot models/L2CSNet_gaze360.pkl \
 --gpu 0 \
 --cam 0 \

This means the demo will run using L2CSNet_gaze360.pkl pretrained model

Community Contributions

MPIIGaze

We provide the code for train and test MPIIGaze dataset with leave-one-person-out evaluation.

Prepare datasets

  • Download MPIIFaceGaze dataset from here.
  • Apply data preprocessing from here.
  • Store the dataset to datasets/MPIIFaceGaze.

Train

 python train.py \
 --dataset mpiigaze \
 --snapshot output/snapshots \
 --gpu 0 \
 --num_epochs 50 \
 --batch_size 16 \
 --lr 0.00001 \
 --alpha 1 \

This means the code will perform leave-one-person-out training automatically and store the models to output/snapshots.

Test

 python test.py \
 --dataset mpiigaze \
 --snapshot output/snapshots/snapshot_folder \
 --evalpath evaluation/L2CS-mpiigaze  \
 --gpu 0 \

This means the code will perform leave-one-person-out testing automatically and store the results to evaluation/L2CS-mpiigaze.

To get the average leave-one-person-out accuracy use:

 python leave_one_out_eval.py \
 --evalpath evaluation/L2CS-mpiigaze  \
 --respath evaluation/L2CS-mpiigaze  \

This means the code will take the evaluation path and outputs the leave-one-out gaze accuracy to the evaluation/L2CS-mpiigaze.

Gaze360

We provide the code for train and test Gaze360 dataset with train-val-test evaluation.

Prepare datasets

  • Download Gaze360 dataset from here.

  • Apply data preprocessing from here.

  • Store the dataset to datasets/Gaze360.

Train

 python train.py \
 --dataset gaze360 \
 --snapshot output/snapshots \
 --gpu 0 \
 --num_epochs 50 \
 --batch_size 16 \
 --lr 0.00001 \
 --alpha 1 \

This means the code will perform training and store the models to output/snapshots.

Test

 python test.py \
 --dataset gaze360 \
 --snapshot output/snapshots/snapshot_folder \
 --evalpath evaluation/L2CS-gaze360  \
 --gpu 0 \

This means the code will perform testing on snapshot_folder and store the results to evaluation/L2CS-gaze360.

评论

暂无评论