Open thanhtruongphan opened 1 week ago
That is a very general question. Moreover, we use C++ instead of Python. You have two parts here: 1) Camera interface. 2) Darknet Both are well documented on the net. The best, (and stupid) suggestion is to use Perplexity AI to help you. Here the code for your camera generated by Perplexity AI: Question: I have a Jetson Nano and a webcam. Can you write me a simple Python program using OpenCV to show the camera on my screen? Answer:
import cv2
def show_webcam():
cap = cv2.VideoCapture(0)
while True:
ret, frame = cap.read()
if not ret:
break
cv2.imshow('Webcam', frame)
if cv2.waitKey(1) == 27: # Press ESC to quit
break
cap.release()
cv2.destroyAllWindows()
if __name__ == '__main__':
show_webcam()
Now expand your program step by step integrating darknet. Hint: You could ask to port our program from C++ to Python.
ah, I understand.
just make a dir, then clone all repository, then remove README.md, LICENSE, MASTER.zip. then modify main.cpp file for use.
main.cpp or main.py in my case, right? Thank you so much, I don't know without you :smiling_face_with_tear:
I'm new with these, :smile_cat:
You're are at the beginning of a steep learning curve. The are major differences between python and C++, as the are different languages. You can't modify a C++ file to python. You have to re-write the line (mostly line by line). Sometimes C++ operations are not possible in python or visa versa. Google (and Perplexity) are you're best frineds.
yah, and Claude Ai, too :+1:
Hi @Qengineering , I did the instructions at Hands-on and run software in code:Block okay.
But I don't know how to use on my Jetson nano with real camera, idea is perform it on a python code. Help me, pls!