Blechon
January 19, 2022, 1:40am
#1
Estoy implementando un modelo en la raspberry pi 4, ya descargue el modelo .eim y estoy utilizando uno de los ejemplos para poder ejecutar con python.
En el codigo me dice que ingrese la direccion del modelo y la direccion del video mp4, despues de hacer eso el porgrama solo imprime lo que habia escrito y no ejecuta el modelo.
def help():
print(‘python classify-video.py <path_to_model.eim> <path_to_video.mp4>’)
ejemplo de mi codigo:
print(‘python classify-video.py </home/pi/linux-sdk-python/examples/custom/modelfile.eim </home/pi/video.mp4>’)
¿como puedo hacer para que corra mi modelo con python?
aurel
January 19, 2022, 10:02am
#2
Hi @Blechon ,
You need to pass the modelfile and the mp4 as parameters, for instance:
python classify-video.py /home/pi/modelfile.eim /home/pi/video.mp4
Aurelien
Blechon
January 20, 2022, 2:14am
#3
Buenas noches @aurel
ya he escrito la direccion correctamente como me indico, pero no ejecuta ningun programa ni tampoco me da un error, solo imprime lo que habia puesto.
¿Tal vez hay que modificar algo más en el codigo para que ejecute correctamente?
he probado ejecutando estos dos ejemplos y tengo el mismo problema en esa parte:
#!/usr/bin/env python
import device_patches # Device specific patches for Jetson Nano (needs to be before importing cv2)
import cv2
import os
import time
import sys, getopt
import numpy as np
from edge_impulse_linux.image import ImageImpulseRunner
runner = None
# if you don't want to see a video preview, set this to False
show_camera = True
if (sys.platform == 'linux' and not os.environ.get('DISPLAY')):
show_camera = False
def help():
print('python classify-video.py <path_to_model.eim> <path_to_video.mp4>')
This file has been truncated. show original
#!/usr/bin/env python
import device_patches # Device specific patches for Jetson Nano (needs to be before importing cv2)
import cv2
import os
import sys, getopt
import signal
import time
from edge_impulse_linux.image import ImageImpulseRunner
runner = None
# if you don't want to see a camera preview, set this to False
show_camera = True
if (sys.platform == 'linux' and not os.environ.get('DISPLAY')):
show_camera = False
def now():
return round(time.time() * 1000)
This file has been truncated. show original
¡ayuda por favor¡
aurel
January 20, 2022, 11:05am
#4
Hi @Blechon ,
You don’t need to modify the code. In your screenshot, you’re not passing any argument to the python script which is why it prints out the help() output.
Just open a terminal prompt and run the command: python classify-video.py /home/pi/modelfile.eim /home/pi/video.mp4
.
Aurelien