ar-cutpaste icon indicating copy to clipboard operation
ar-cutpaste copied to clipboard

BASnet Error

Open simeonbanks opened this issue 4 years ago • 18 comments

Hi,

When try to capture from the app on my android tablet, the image gets to BASNet it produces the below.

Can you advise please?

Thanks, Simeon

NFO:root: > sending to BASNet... INFO:werkzeug:192.168.1.158 - - [06/May/2020 17:16:53] "POST /cut HTTP/1.1" 500 - Traceback (most recent call last): File "/Users/simeonbanks/Downloads/ar-cutpaste-master/server/venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 417, in _make_request httplib_response = conn.getresponse(buffering=True) TypeError: getresponse() got an unexpected keyword argument 'buffering'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Users/simeonbanks/Downloads/ar-cutpaste-master/server/venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 677, in urlopen chunked=chunked, File "/Users/simeonbanks/Downloads/ar-cutpaste-master/server/venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 426, in _make_request six.raise_from(e, None) File "", line 3, in raise_from # Permission is hereby granted, free of charge, to any person obtaining a copy File "/Users/simeonbanks/Downloads/ar-cutpaste-master/server/venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 421, in _make_request httplib_response = conn.getresponse() File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/client.py", line 1344, in getresponse response.begin() File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/client.py", line 306, in begin version, status, reason = self._read_status() File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/client.py", line 275, in _read_status raise RemoteDisconnected("Remote end closed connection without" http.client.RemoteDisconnected: Remote end closed connection without response

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Users/simeonbanks/Downloads/ar-cutpaste-master/server/venv/lib/python3.7/site-packages/requests/adapters.py", line 449, in send timeout=timeout File "/Users/simeonbanks/Downloads/ar-cutpaste-master/server/venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 725, in urlopen method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2] File "/Users/simeonbanks/Downloads/ar-cutpaste-master/server/venv/lib/python3.7/site-packages/urllib3/util/retry.py", line 403, in increment raise six.reraise(type(error), error, _stacktrace) File "/Users/simeonbanks/Downloads/ar-cutpaste-master/server/venv/lib/python3.7/site-packages/urllib3/packages/six.py", line 734, in reraise raise value.with_traceback(tb) File "/Users/simeonbanks/Downloads/ar-cutpaste-master/server/venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 677, in urlopen chunked=chunked, File "/Users/simeonbanks/Downloads/ar-cutpaste-master/server/venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 426, in _make_request six.raise_from(e, None) File "", line 3, in raise_from # Permission is hereby granted, free of charge, to any person obtaining a copy File "/Users/simeonbanks/Downloads/ar-cutpaste-master/server/venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 421, in _make_request httplib_response = conn.getresponse() File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/client.py", line 1344, in getresponse response.begin() File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/client.py", line 306, in begin version, status, reason = self._read_status() File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/client.py", line 275, in _read_status raise RemoteDisconnected("Remote end closed connection without" urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Users/simeonbanks/Downloads/ar-cutpaste-master/server/venv/lib/python3.7/site-packages/flask/app.py", line 2463, in call return self.wsgi_app(environ, start_response) File "/Users/simeonbanks/Downloads/ar-cutpaste-master/server/venv/lib/python3.7/site-packages/flask/app.py", line 2449, in wsgi_app response = self.handle_exception(e) File "/Users/simeonbanks/Downloads/ar-cutpaste-master/server/venv/lib/python3.7/site-packages/flask_cors/extension.py", line 161, in wrapped_function return cors_after_request(app.make_response(f(*args, **kwargs))) File "/Users/simeonbanks/Downloads/ar-cutpaste-master/server/venv/lib/python3.7/site-packages/flask/app.py", line 1866, in handle_exception reraise(exc_type, exc_value, tb) File "/Users/simeonbanks/Downloads/ar-cutpaste-master/server/venv/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise raise value File "/Users/simeonbanks/Downloads/ar-cutpaste-master/server/venv/lib/python3.7/site-packages/flask/app.py", line 2446, in wsgi_app response = self.full_dispatch_request() File "/Users/simeonbanks/Downloads/ar-cutpaste-master/server/venv/lib/python3.7/site-packages/flask/app.py", line 1951, in full_dispatch_request rv = self.handle_user_exception(e) File "/Users/simeonbanks/Downloads/ar-cutpaste-master/server/venv/lib/python3.7/site-packages/flask_cors/extension.py", line 161, in wrapped_function return cors_after_request(app.make_response(f(*args, **kwargs))) File "/Users/simeonbanks/Downloads/ar-cutpaste-master/server/venv/lib/python3.7/site-packages/flask/app.py", line 1820, in handle_user_exception reraise(exc_type, exc_value, tb) File "/Users/simeonbanks/Downloads/ar-cutpaste-master/server/venv/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise raise value File "/Users/simeonbanks/Downloads/ar-cutpaste-master/server/venv/lib/python3.7/site-packages/flask/app.py", line 1949, in full_dispatch_request rv = self.dispatch_request() File "/Users/simeonbanks/Downloads/ar-cutpaste-master/server/venv/lib/python3.7/site-packages/flask/app.py", line 1935, in dispatch_request return self.view_functionsrule.endpoint File "/Users/simeonbanks/Downloads/ar-cutpaste-master/server/src/main.py", line 74, in save res = requests.post(args.basnet_service_ip, headers=headers, files=files ) File "/Users/simeonbanks/Downloads/ar-cutpaste-master/server/venv/lib/python3.7/site-packages/requests/api.py", line 119, in post return request('post', url, data=data, json=json, **kwargs) File "/Users/simeonbanks/Downloads/ar-cutpaste-master/server/venv/lib/python3.7/site-packages/requests/api.py", line 61, in request return session.request(method=method, url=url, **kwargs) File "/Users/simeonbanks/Downloads/ar-cutpaste-master/server/venv/lib/python3.7/site-packages/requests/sessions.py", line 530, in request resp = self.send(prep, **send_kwargs) File "/Users/simeonbanks/Downloads/ar-cutpaste-master/server/venv/lib/python3.7/site-packages/requests/sessions.py", line 643, in send r = adapter.send(request, **kwargs) File "/Users/simeonbanks/Downloads/ar-cutpaste-master/server/venv/lib/python3.7/site-packages/requests/adapters.py", line 498, in send raise ConnectionError(err, request=request) requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))

Permission is hereby granted, free of charge, to any person obtaining a copy

File "/Users/simeonbanks/Downloads/ar-cutpaste-master/server/venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 421, in _make_request httplib_response = conn.getresponse() File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/client.py", line 1344, in getresponse response.begin() File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/client.py", line 306, in begin version, status, reason = self._read_status() File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/client.py", line 275, in _read_status raise RemoteDisconnected("Remote end closed connection without" http.client.RemoteDisconnected: Remote end closed connection without response

simeonbanks avatar May 06 '20 16:05 simeonbanks

Same

oniyakun avatar May 06 '20 17:05 oniyakun

Does you BASNet service work when called directly?

cyrildiagne avatar May 06 '20 20:05 cyrildiagne

Does you BASNet service work when called directly?

If i browse locally to 127.0.0.1:80 i do get the Hello message.

simeonbanks avatar May 06 '20 20:05 simeonbanks

And if you send an image using cURL or Postman?

On Wed, 6 May 2020 at 22:03, simeonbanks [email protected] wrote:

Does you BASNet service work when called directly?

If i browse locally to 127.0.0.1:80 i do get the Hello message.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/cyrildiagne/ar-cutpaste/issues/25#issuecomment-624860572, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABDH5AZ4QMO7H73C2Y7LSLRQG7BHANCNFSM4M2SVPCA .

cyrildiagne avatar May 06 '20 20:05 cyrildiagne

And if you send an image using cURL or Postman? On Wed, 6 May 2020 at 22:03, simeonbanks @.***> wrote: Does you BASNet service work when called directly? If i browse locally to 127.0.0.1:80 i do get the Hello message. — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#25 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABDH5AZ4QMO7H73C2Y7LSLRQG7BHANCNFSM4M2SVPCA .

The BASNet shows "[CRITICAL] WORKER TIMEOUT (pid:xx)" and it restart worker and repeated the same message again, It seems BASNet didnt running properly in the docker and I have no idea what caused it

oniyakun avatar May 07 '20 06:05 oniyakun

And I noticed that nvidia-docker didnt support the windows docker engine https://github.com/NVIDIA/nvidia-docker/issues/665, could this be the cause of this problem?

oniyakun avatar May 07 '20 07:05 oniyakun

Yes the docker image is probably not using the Nvidia card and timing out. Could you try increasing the timeout of gunicorn https://docs.gunicorn.org/en/stable/settings.html#timeout (and also the client you're making the request with) to check if that's the issue?

Cyril Diagne

On Thu, 7 May 2020 at 09:08, 五十嵐です [email protected] wrote:

And I noticed that nvidia-docker didnt support the windows docker engine NVIDIA/nvidia-docker#665 https://github.com/NVIDIA/nvidia-docker/issues/665, could this be the cause of this problem?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/cyrildiagne/ar-cutpaste/issues/25#issuecomment-625072355, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABDH5GBZSYOTLE6A57JD3LRQJM5TANCNFSM4M2SVPCA .

cyrildiagne avatar May 07 '20 07:05 cyrildiagne

I deployed the BASNet to another Linux GPU Server and got the different result

The docker: HIKQJT0WIT )8T0(A(GDH(W

My iPhone IMG_1729

oniyakun avatar May 07 '20 07:05 oniyakun

Can you check again if BASNet works when called directly? (via cURL or Postman)

cyrildiagne avatar May 07 '20 07:05 cyrildiagne

Yes, It shows 'Hello BASNet!' and u can check it by yourself at here http://178.170.39.160:50505

oniyakun avatar May 07 '20 07:05 oniyakun

But if you send an image?

--

Cyril Diagne

On Thu, 7 May 2020 at 09:27, 五十嵐です [email protected] wrote:

Yes, It shows 'Hello BASNet!' and u can check it by yourself at here http://178.170.39.160:50505

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/cyrildiagne/ar-cutpaste/issues/25#issuecomment-625080483, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABDH5APQ72D3U357TMFRLTRQJPHNANCNFSM4M2SVPCA .

cyrildiagne avatar May 07 '20 07:05 cyrildiagne

I got the result.png like this result

oniyakun avatar May 07 '20 07:05 oniyakun

I tried it again and get the nice result image result2

oniyakun avatar May 07 '20 07:05 oniyakun

I tried use my Android Phone and it show some different log right here 4 8M%JEHIK9BGKYMM(60}XN But still, not working as expect

oniyakun avatar May 07 '20 08:05 oniyakun

And it created three of the images like this image Seems the cut function working good but it didnt paste it into the place they should be

oniyakun avatar May 07 '20 08:05 oniyakun

Can you check the coordinates sent back by screenpoint? If you get -1, -1 then it probably failed at matching the screen from the phone image. Make sure you have distinctive features as background of your document and not just a blank document.

cyrildiagne avatar May 08 '20 11:05 cyrildiagne

Can you check the coordinates sent back by screenpoint? If you get -1, -1 then it probably failed at matching the screen from the phone image. Make sure you have distinctive features as background of your document and not just a blank document.

Tell me how to do this

oniyakun avatar May 09 '20 08:05 oniyakun

@oniyakun Hey, did he tell you? I'm getting blank layers when pasting so perhaps this is why

Marigno avatar Jul 28 '20 00:07 Marigno