Ask Your Question
0

python exe erro

asked 2018-09-14 13:39:46 -0600

Aleander gravatar image

I'm trying to create an EXE from an object-detector code I made but the following errorimage description

codigo
    import dlib
import cv2
import sys
import imutils
from imutils.video import VideoStream

ip = "rtsp://admin:[email protected]/doc/page/preview.asp"
detector = dlib.simple_object_detector('C:/detectordeobjetos/ia.svm')

Nome = 'Detector de Objetos'
fonte = cv2.FONT_ITALIC

captura = VideoStream(ip).start()

x = 0
tempo = 0
sinal = 0

while True:
    from datetime import datetime
data_e_hora_atuais = datetime.now()
data_e_hora_em_texto = data_e_hora_atuais.strftime('%d/%m/%Y %H:%M')


frame = captura.read()
frame = imutils.resize(frame, 1200)
#1200 = mais que 2 horas
#1300 = n tes
#1400 = n tes
frame = cv2.cvtColor(frame ,cv2.COLOR_BGR2GRAY)
sinal += 1
print(sinal)
objetosDetectados = detector(frame, 1)
for o in objetosDetectados:
    e, t, d, f = (int(o.left()), int(o.top()), int(o.right()), int(o.bottom()))
    cv2.rectangle(frame, (e, t), (d, f), (0, 220, 0), 1)
    cv2.putText(frame, 'Eixo Detectado', (e, t), fonte, 1.0, (0, 255, 0), 2, cv2.LINE_4)
    print("Objeto foi detectado")

    sinal = 0
    #v2.destroyAllWindows()
    #time.sleep(60)
if sinal == 5:
    xml = ("""<?xml version="1.0" encoding="iso-8859-1"?>
                <calls>
                <call>
                <id>0000</id>
                <mac>0013A20040A768C4</mac>
                <bat>2.23</bat>
                <dthora>""" + str(data_e_hora_em_texto) + """</dthora> </call> </calls>""")
    url = 'http://mmscon.cnhindustrial.ind.br/cnhind/mms/cebh/roti01.php'
   # r = requests.post(url, {'data': xml}).text
    #print(r)


#       cv2.destroyAllWindows()
#        time.sleep(1200)
        sinal = 0
    cv2.imshow("Frame", frame)
    if cv2.waitKey(1) & 0xAA == 27:
            break

captura.release()
cv2.destroyAllWindows()
captura.stop()
sys.exit(0)

form that creates the exe pyinstaller --onefile program.py

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2018-11-19 20:52:42 -0600

supra56 gravatar image

I have 2 of them to suit your needed. py3exe and nuitka

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2018-09-14 13:39:46 -0600

Seen: 381 times

Last updated: Nov 19 '18