From mk1853387 at gmail.com Sat Oct 5 13:55:36 2024 From: mk1853387 at gmail.com (marc nicole) Date: Sat, 5 Oct 2024 19:55:36 +0200 Subject: [Tutor] How to check whether lip movement is significant using face landmarks in dlib? Message-ID: I am trying to assess whether the lips of a person are moving too much while the mouth is closed (to conclude they are chewing). I try to assess the lip movement through landmarks (dlib) : Inspired by the mouth example ( https://github.com/mauckc/mouth-open/blob/master/detect_open_mouth.py#L17), and using it before the following function (as a primary condition for telling the person is chewing), I wrote the following function: def lips_aspect_ratio(shape): # grab the indexes of the facial landmarks for the lip (mStart, mEnd) = (61, 68) lip = shape[mStart:mEnd] print(len(lip)) # compute the euclidean distances between the two sets of # vertical lip landmarks (x, y)-coordinates # to reach landmark 68 I need to get lib[7] not lip[6] (while I get lip[7] I get IndexOutOfBoundError) A = dist.euclidean(lip[1], lip[6]) # 62, 68 B = dist.euclidean(lip[3], lip[5]) # 64, 66 # compute the euclidean distance between the horizontal # lip landmark (x, y)-coordinates C = dist.euclidean(lip[0], lip[4]) # 61, 65 # compute the lip aspect ratio mar = (A + B) / (2.0 * C) # return the lip aspect ratio return mar How to define an aspect ratio for the lips to conclude they are moving significantly? Is the mentioned function able to tell whether the lips are significantly moving while the mouth is closed? From avi.e.gross at gmail.com Sun Oct 6 16:43:10 2024 From: avi.e.gross at gmail.com (avi.e.gross at gmail.com) Date: Sun, 6 Oct 2024 16:43:10 -0400 Subject: [Tutor] Clarification on .format() Method and Negative Indices in Python In-Reply-To: <02fc01db1830$42ceaf60$c86c0e20$@gmail.com> References: <02fc01db1830$42ceaf60$c86c0e20$@gmail.com> Message-ID: <02ff01db1830$5b224130$1166c390$@gmail.com> Hi, I'm not responding to what was designed for this one of many ways to print but suggesting a way to get what you want another way. Consider using an fstring as in this example: >>> example="ABCDE" >>> example[-1] 'E' >>> print(f"last char in example is: {example[-1]}") last char in example is: E Anything in an f-string between curly braces is evaluated and replaced and negative numbers are supported. Of course, if someday they change your other way, feel free to use that. And, of course, you can preprocess what you want before using your print method into a small variable, as another workaround. -----Original Message----- From: Tutor On Behalf Of Xingyuan Shi via Tutor Sent: Tuesday, September 24, 2024 10:23 PM To: tutor at python.org Subject: [Tutor] Clarification on .format() Method and Negative Indices in Python Dear Python Tutor Team, I hope you are having a great day. I have been learning more about Python?s string formatting, and I came across an interesting issue regarding the .format() method. Specifically, I was curious as to why negative indices like {-1} are not supported in this method, while negative indexing works perfectly with lists and other sequences in Python. For instance, I attempted to use the following code: print("{-1},{-1},{-1}".format(20, "example", 3.14)) I expected the placeholders {-1} to behave similarly to negative indices in lists, but it resulted in an error. I understand that .format() relies on positional arguments, but I wonder if there was a specific design rationale behind not allowing negative indices here. Could you shed some light on this design choice? Thank you very much for your time and for developing such an incredible language that I thoroughly enjoy learning. Best regards, Stone _______________________________________________ Tutor maillist - Tutor at python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor From PythonList at DancesWithMice.info Mon Oct 7 04:32:45 2024 From: PythonList at DancesWithMice.info (dn) Date: Mon, 7 Oct 2024 21:32:45 +1300 Subject: [Tutor] How to check whether lip movement is significant using face landmarks in dlib? In-Reply-To: References: Message-ID: <99d45736-1a35-4a3b-a2ce-41ae3a8b2a1b@DancesWithMice.info> On 6/10/24 06:55, marc nicole via Tutor wrote: > I am trying to assess whether the lips of a person are moving too much > while the mouth is closed (to conclude they are chewing). > > I try to assess the lip movement through landmarks (dlib) : The Austin Python Meetup Monthly Meetup This is a virtual event. Talk one: Cameron James will be showing her project MoviEmotion for Detecting facial emotions with AI image recognition models. With the objective to identify exactly which movie moments resonate most with the audience. Cameron James SWE (Principal Eng) --> Portfolio Manager --> Program Director, all in F200, BigCoRetail IT, and BigTech. - Tech has always been a thrill for me. Machine learning and AI took it to a new level. ---- Wednesday (in TX) https://www.meetup.com/austinpython/events/301678835/ -- Regards, =dn From avi.e.gross at gmail.com Tue Oct 8 19:43:35 2024 From: avi.e.gross at gmail.com (avi.e.gross at gmail.com) Date: Tue, 8 Oct 2024 19:43:35 -0400 Subject: [Tutor] Signing off In-Reply-To: <007701d89150$1dea86b0$59bf9410$@gmail.com> References: <008a01d890e0$756336a0$6029a3e0$@gmail.com> <7143f0d4-0fdf-88eb-22d9-391065b28044@yahoo.co.uk> <007701d89150$1dea86b0$59bf9410$@gmail.com> Message-ID: <012d01db19db$e42d7c40$ac8874c0$@gmail.com> Just a final brief note. I am leaving the python community so don't worry that anything happened to me. I have a disagreement with the direction some people are taking with the python community that is my issue and it that probably will not bother most people. I have lots of other interests including many other programming languages and it is time I stopped using python when I have so much else to choose from. My best wishes to everyone here. Avi From leamhall at gmail.com Wed Oct 9 05:20:54 2024 From: leamhall at gmail.com (Leam Hall) Date: Wed, 9 Oct 2024 04:20:54 -0500 Subject: [Tutor] Signing off In-Reply-To: <012d01db19db$e42d7c40$ac8874c0$@gmail.com> References: <008a01d890e0$756336a0$6029a3e0$@gmail.com> <7143f0d4-0fdf-88eb-22d9-391065b28044@yahoo.co.uk> <007701d89150$1dea86b0$59bf9410$@gmail.com> <012d01db19db$e42d7c40$ac8874c0$@gmail.com> Message-ID: <6dbdef86-04fe-3b65-3588-eef3fb5b50da@gmail.com> On 10/8/24 18:43, avi.e.gross--- via Tutor wrote: > Just a final brief note. > > I am leaving the python community so don't worry that anything happened to me. I have a disagreement with the direction some people are taking with the python community that is my issue and it that probably will not bother most people. > > I have lots of other interests including many other programming languages and it is time I stopped using python when I have so much else to choose from. > > My best wishes to everyone here. > > Avi Avi, wishing you well in you future endeavors. Leam -- Automation Engineer (reuel.net/resume) Scribe: The Domici War (domiciwar.net) General Ne'er-do-well (github.com/LeamHall) From jblanca at upv.es Thu Oct 10 04:13:18 2024 From: jblanca at upv.es (=?iso-8859-1?Q?Jos=E9_Miguel_Blanca_Postigo_Jose_Miguel?=) Date: Thu, 10 Oct 2024 08:13:18 +0000 Subject: [Tutor] introduction to programming course Message-ID: Hi, I have been teaching a programming introductory course for a number of years using Python. This time I have prepared an interactive site for the students. https://bioinf.comav.upv.es/courses/intro_programming/ It is focused on examples and exercises, so not a lot of theory. I would welcome suggestions and fixes. This course might be useful for somebody in this list, but I am not sure if this is the correct place to inform the community about this resource, but since this is a list related to Python teaching I have thought that it might be the place. Sorry if this is not the intended use of the list. Best regards, Jos? Blanca From reemmutairy7 at gmail.com Sun Oct 13 01:25:21 2024 From: reemmutairy7 at gmail.com (Reem Mutairy) Date: Sun, 13 Oct 2024 05:25:21 +0000 Subject: [Tutor] Python Security Survey - Your Expertise Needed! Message-ID: Hello Python Developers and Security Engineers, I?m Reem Almutairi, a Ph.D. student in Software Engineering at King Saud University. I?m conducting research to better understand the prevalence and impact of security vulnerabilities in Python, as well as the strategies developers use to mitigate these risks. If you have experience in Python and are familiar with security vulnerabilities, I?d greatly appreciate your input in this 10-minute survey. ? [ https://n9.cl/2ow2c [https://lh6.googleusercontent.com/2RkP1spcsyjz1WD_HnUioMUEHvWWna6Cn0HrU7U9V_HKwXbnWsXr7futHg1JDb2m_k01A8ttA8A=w1200-h630-p] Identifying Key Software Security Vulnerabilities (Security Smells) in Python Applications n9.cl ] Also, if you know others who might be interested, please feel free to share the survey link with them! Your insights will help shape future security practices in Python development. Thank you in advance for your time and expertise. Warm regards, Reem Almutairi Ph.D. Student, Software Engineering King Saud University