0

I'm building a python application that uses AI to scan a live feed with OpenCV and tracks people with or without masks.

I wanted to ask if there was a good way to send a unique dataframe for every unique entity tracked in the feed in order to create a procedural entry on a database of each person tracked as they entered the frame and whether they were wearing a mask.

Any advice?

1 Answers1

1

You could make a pandas dataframe with two columns: Name and isWearingMask, and append that dataframe with a new row every time a person is detected. Then use the time module to know to save the pandas database as a .CSV file at the end of a day. The next day, clear the pandas dataframe and repeat the process.

DapperDuck
  • 2,728
  • 1
  • 9
  • 21
  • Nice thanks, got you in terms of the structure of the dataframe! WHat if the addition to the DB were to be in real time for every new person – ProspektsMarch Apr 26 '21 at 12:53
  • I'm guessing you are using opencv to capture video, and then feeding the frames to the tensorflow model. After you get the output, you can convert the values to strings, and then save them as variables. Then create a Pandas series with those variables, and append that to the dataframe. You'll likely have to use some if-then statements to check if the person that was detected was also wearing a mask, for example. – DapperDuck Apr 26 '21 at 18:32