Zakeiswo / TeaSys_Dev

Use for st-gcn to build a system.The system is used to get the score of a new teacher's actions in a class.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Welcome to TeaSys_Dev 👋

Documentation Maintenance License: MIT

Use for st-gcn to build a system which is used to compute the score of a teacher's actions in a class.

Intruduction

This project is used to compute the score of the a teacher action in a class. You can use the video data as the input, the output of it is the score and the video(Optional).

Before start

You have to use the St-gcn-tea which base on the St-gcn to get the action sequeues.
You can download the St-gcn-tea in the page:St-gcn-tea.
The path of the video need to be changed.
In fact, the input of video can be too big to deal with. With the 8GB RAM and GTX1080,I can deal with around 4 minutes 320x180 video one time. I have write the a file to deal with this situation, which cut the video into 4 minutes clips and put them into the st-gcn-tea.
However, you must change the path of the code to apply to your own computer environment.
You can get the csv or json data from the St-gcn-tea when you use the video as the input.
Run the St-gcn-tea by this command:

Python3 batch_stgcn_plus.py

*The viewpoint of the video you used have to be the front of the blackboard.

Prerequisites

Python >=3.0

python package:
fuzzywuzzy >=0.17.0

Run

When you want use this project you have to get the csv data of the video from the St-gcn-tea first.
Than you have change the path of the data in main function.

About my code , there are 2 parts of the process, first part is used to deal with the original data the next is using the processed data to compute the score.

In the first part , you have to build the Object of ProTeacher and NewTeacher class to deal with the dat. This part only need to run when the new data come. The next time you can comment out the code of this part.
Class NewTeacher is also the same way.You can use this code to build and deal with the new data:

prot = ProTeacher(<Name of the teacher>, <The path of the data>, <The path to save the processed data>)
prot.pfdicSaver()

The next part you is about the score computation.
≥≥First, you need to build a object of TestTeacher

t = TestTeacher(<Name>, <The path of data>)

Than you have to read the processed data

t.jsonReader_pf_onetime(<The path of the processed data>,<Name>,<0 or 1 ,when o means new and 1 means pro >)

Then you need use this code to delete the common patterns:

t.dicCommonDeleteOnetime() 

Then you should use this code to compress the data from 48 results into 1 action. Also you can change the 48 to another range : You can choose to use kojima function or not.
When use Kojima function:

 t.compressList_id_t(main.tools.actionrewriter(t.ac_list_ori), 4, 8)

Without Kojima function:

 t.compressList_id_t(t.ac_list_ori, 4, 8)

Then we use this code to matching the patterns in the new and pro dataset:

t.patternCheeker(maxlen)

Next, use this code to delete the pattern when the matching times is one. You can change the parameter if you want to delete the the matching times is more than one:

t.patterncleanerfortesttea(<Matching times, eg.1>)

Then you can use this code to output the score:

print(t.scorecalculater_ave())

If you want to get the visualized video, you can use this code to get the JSON file for creating the video:

t.visualization(<Path to save the JSON file>,t.name)

After changing the main function, you can run the project by this commend:

python3 testteacher.py

Visualization

If you want to get the result of video ,you can download the demo of my video maker: st-gcn-video
You need change the path of the JSON file in demo.py in this video maler and than run the code by this comment:

python3 demo.py

*Attention the RAM of my computer is 16GB, the resolution of video I used is 320×180, time of the video is around 20 minutes.

Author

👤 Zake(Yao Shunyu)

🤝 Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page.

Show your support

Give a ⭐️ if this project helped you!

📝 License

Copyright © 2019 Zake(Yao Shunyu).
This project is MIT licensed.


This README was generated with ❤️ by readme-md-generator

About

Use for st-gcn to build a system.The system is used to get the score of a new teacher's actions in a class.


Languages

Language:Python 100.0%