waityousea / xuniren

MIT License
551 stars 159 forks source link

建立连接之后报错 #34

Open aoyang-hd opened 5 months ago

aoyang-hd commented 5 months ago

建立连接! [WARN] audio sample rate is 24000, resampling into 16000. [INFO] loaded audio stream data/audio/aud_0.wav: (55680,) [START] haj ajam dablo es klajent [END] [INFO] save all feats for training purpose... [INFO] saved logits to data/audio/aud_0_eo.npy [INFO] load 3508 frames. [INFO] load data/audio/aud_0_eo.npy aud_features: torch.Size([87, 44, 16]) Loading data: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3508/3508 [00:00<00:00, 80353.99it/s] [INFO] eye_area: 0.25 - 0.25 ==> Start Test, save results to data/video/results 0% 0/87 [00:00<?, ?it/s]Traceback (most recent call last): File "/home/cv/.conda/envs/torch3d_ay/lib/python3.9/site-packages/gevent/pywsgi.py", line 1107, in handle_one_response self.run_application() File "/home/cv/.conda/envs/torch3d_ay/lib/python3.9/site-packages/geventwebsocket/handler.py", line 75, in run_application self.run_websocket() File "/home/cv/.conda/envs/torch3d_ay/lib/python3.9/site-packages/geventwebsocket/handler.py", line 52, in run_websocket list(self.application(self.environ, lambda s, h, e=None: [])) File "/home/cv/.conda/envs/torch3d_ay/lib/python3.9/site-packages/flask/app.py", line 2464, in call return self.wsgi_app(environ, start_response) File "/home/cv/.conda/envs/torch3d_ay/lib/python3.9/site-packages/flask_sockets.py", line 45, in call handler(environment, **values) File "/data/cv/aoyang/xuniren-main/app.py", line 87, in echo_socket generate_video(audio_path, audio_path_eo, video_path, output_path) File "/data/cv/aoyang/xuniren-main/tools.py", line 606, in generate_video path = video_process(opt_vid, trainer_vid, model_vid, dir_path) File "/data/cv/aoyang/xuniren-main/tools.py", line 586, in video_process test = trainer.test(test_loader, name=dir_path['input'].split("/")[-1].split(".")[0]) File "/data/cv/aoyang/xuniren-main/nerf/utils.py", line 967, in test video_stream.write([pred]) File "/data/cv/aoyang/xuniren-main/video_stream.py", line 8, in write video_stream_cache.write(frame) AttributeError: 'NoneType' object has no attribute 'write' 2024-01-25T06:56:37Z {'REMOTE_ADDR': '127.0.0.1', 'REMOTE_PORT': '53192', 'HTTP_HOST': '0.0.0.0:38800', (hidden keys: 25)} failed with AttributeError

aoyang-hd commented 5 months ago

我服了 xuniren-main/nerf/utils.py 里面video_stream都没有start? 938行加入

video_stream.start()

就可以了

aoyang-hd commented 5 months ago

大家启动 python app.py后 用以下代码可以调用

from websocket import create_connection

def client_handle():
    ws = create_connection('ws://127.0.0.1:8800/dighuman')
    while True:
        if ws.connected:
            ws.send('你好,我叫王尼玛,我来自中国,21岁了')
            result = ws.recv()
            print(f"client received:{result}")
            # ws.close()

if __name__ == "__main__":
    client_handle()
Qingshan0153 commented 5 months ago

我服了 xuniren-main/nerf/utils.py 里面video_stream都没有start? 938行加入

video_stream.start()

就可以了

亲测成功,感谢大佬