I'm doing a face recognition project that uses opencv and python to recognize a person's face on a pc. Now, my goal is to use a raspberry pi to access one of my gpio ports, and when One face was detected in my pc then to turn on a led. My problem is how can I connect my pc to a raspberry pi and use the code that runs on my pc to run the raspberry pi gpio?
Use pigpio or GPIOZero with python. That allows a python program running anywhere to connect to your RPi and change the status of GPIO pins.