• Как сделать функцию превращающую координаты в градусы?

    @zeni1agent Автор вопроса
    Извини но я давно не имел дела с тригонометрией но кажется я допустил где то ошибку
    function fun(degrees, distance) { 
    var x1 = distance * Math.cos(degrees); 
    var y1 = distance * Math.sin(degrees); 
      
    var arr = [x1, y1]
    
    return arr;
    }
    
    alert (fun(90, 5)) ;
  • Как взаимодействовать с помощью js на свойство transform?

    @zeni1agent Автор вопроса
    Вы можете сказать как в rematrix
    Получить какое либо значение из
    rotate(0deg); translate(120px, 50%); scale(2, 0.5); skew(30deg, 20deg);

    Потому что в документаций я нашел только как преобразовать свойство в matrix
    Rematrix.rotateZ(45)
    И как перевести несколько свойств в matrix
    let element = document.querySelector('#example')
    let style = getComputedStyle(element).transform
    
    let transform = Rematrix.fromString(style)
    
    let r1 = Rematrix.rotateZ(20)
    let r2 = Rematrix.rotateZ(65)
    let r3 = Rematrix.rotateZ(-40)
    
    let product = [transform, r1, r2, r3].reduce(Rematrix.multiply)

    Я не смог найти как из matrix достать какое либо свойство
    И если он все таки возвращает то в каких единицах измерения (deg, px, %)&
  • Почему toPath не возвращает острый угол?

    @zeni1agent Автор вопроса
    Kovalsky, Вот что выводит ToPoint и toPath
    ToPoint
    0:
    moveTo: true
    x: 1037.5
    y: 403.5
    __proto__: Object
    1:
    curve: {type: "cubic", x1: 958.4300000000001, y1: 388.64, x2: 705.5, y2: 366.5}
    x: 705.5
    y: 366.5
    __proto__: Object
    2:
    curve: {type: "cubic", x1: 0, y1: 0, x2: 0, y2: 0}
    x: 670.5
    y: 7.5
    __proto__: Object
    3:
    curve: {type: "cubic", x1: 0, y1: 0, x2: 0, y2: 0}
    x: 654.5
    y: 365.5
    __proto__: Object
    4:
    curve: {type: "cubic", x1: 0, y1: 0, x2: 0, y2: 0}
    x: 302.5
    y: 393.5
    __proto__: Object
    5:
    curve: {type: "cubic", x1: 0, y1: 0, x2: 0, y2: 0}
    x: 653.71
    y: 409.33
    __proto__: Object
    6:
    curve: {type: "cubic", x1: 0, y1: 0, x2: 0, y2: 0}
    x: 682.5
    y: 751.5
    __proto__: Object
    7:
    curve: {type: "cubic", x1: 0, y1: 0, x2: 0, y2: 0}
    x: 702.5
    y: 408.29
    __proto__: Object
    8:
    curve: {type: "cubic", x1: 0, y1: 0, x2: 0, y2: 0}
    x: 1037.5
    y: 403.5
    __proto__: Object

    toPath
    M1037.5,403.5C958.4300000000001,388.64,705.5,366.5,705.5,366.5C0,0,0,0,670.5,7.5C0,0,0,0,654.5,365.5C0,0,0,0,302.5,393.5C0,0,0,0,653.71,409.33C0,0,0,0,682.5,751.5C0,0,0,0,702.5,408.29C0,0,0,0,1037.5,403.5Z

    Если удалить все curve: {type: "cubic", x1:0, y1:0, x2:0, y2:0}
    ToPoint
    0:
    moveTo: true
    x: 1037.5
    y: 403.5
    __proto__: Object
    1:
    curve: {type: "cubic", x1: 958.4300000000001, y1: 388.64, x2: 705.5, y2: 366.5}
    x: 705.5
    y: 366.5
    __proto__: Object
    2:
    x: 670.5
    y: 7.5
    __proto__: Object
    3:
    x: 654.5
    y: 365.5
    __proto__: Object
    4:
    x: 302.5
    y: 393.5
    __proto__: Object
    5:
    x: 653.71
    y: 409.33
    __proto__: Object
    6:
    x: 682.5
    y: 751.5
    __proto__: Object
    7:
    x: 702.5
    y: 408.29
    __proto__: Object
    8:
    x: 1037.5
    y: 403.5

    toPath
    M1037.5,403.5C958.4300000000001,388.64,705.5,366.5,705.5,366.5L670.5,7.5L654.5,365.5L302.5,393.5L653.71,409.33L682.5,751.5L702.5,408.29Z
  • Можно ли как нибудь настроиь гугл переводчик на перевод картинок с экрана пк?

    @zeni1agent Автор вопроса
    Inodik,
    Нет автоматической зарядки после окончания бесплатного пробного периода
    Мы просим вас указать вашу кредитную карту, чтобы убедиться, что вы не робот.

    Если бы не эти два условия то я бы согласился. А так это очень плохая идея.
  • Можно ли как нибудь настроиь гугл переводчик на перевод картинок с экрана пк?

    @zeni1agent Автор вопроса
    Inodik, Да только они предварительно просят привязать свою собственную карточку чтобы убедится что ты не бот. Тем более 1000 картинок это очень мало когда ты пытаешься перевести каждый кадр игры на иностранном языке.
  • Почему мой код создания морфов работает не стабильно?

    @zeni1agent Автор вопроса
    Kovalsky,
    Код с 1 по 414 строку это копируемые мной функций из староних источников.
    Упрощенные версии функции пересчета массива
    https://codepen.io/zeni-agentt/pen/YzXPOzw
    https://codepen.io/zeni-agentt/pen/WNvbzvx
    Самые простые
    https://codepen.io/zeni-agentt/pen/qBdExMo
    https://codepen.io/zeni-agentt/pen/rNVazwE
    Остальной код это перебор массива и определение того какой ползунок и какой чек бокс запущен.
    Я над каждой стракой написал комментарий правда не очень качественно
    Просто говорю информацию которая у меня есть. вдруг поможет
  • Бот выдает ошибку: json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0). как исправить?

    @zeni1agent Автор вопроса
    Владимир Куц, Вы предлагаете в файле tensorflow_backend.py добавить строку?
    _SYMBOLIC_SCOPE = threading.local()
    _SYMBOLIC_SCOPE.value = True
    _SYMBOLIC_SCOPE.__setattr__('value',_SYMBOLIC_SCOPE.value)
  • Бот выдает ошибку: json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0). как исправить?

    @zeni1agent Автор вопроса
    и

    [2020-02-27 17:25:35,908] ERROR in app: Exception on /predict [POST]
    Traceback (most recent call last):
    File "C:\Python37\lib\site-packages\flask\app.py", line 2446, in wsgi_app
    response = self.full_dispatch_request()
    File "C:\Python37\lib\site-packages\flask\app.py", line 1951, in full_dispatch_request
    rv = self.handle_user_exception(e)
    File "C:\Python37\lib\site-packages\flask\app.py", line 1820, in handle_user_exception
    reraise(exc_type, exc_value, tb)
    File "C:\Python37\lib\site-packages\flask\_compat.py", line 39, in reraise
    raise value
    File "C:\Python37\lib\site-packages\flask\app.py", line 1949, in full_dispatch_request
    rv = self.dispatch_request()
    File "C:\Python37\lib\site-packages\flask\app.py", line 1935, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
    File "C:\Users\admwi\Desktop\simple-keras-rest-api-master\simple-keras-rest-api-master\run_keras_server.py", line 61, in predict
    preds = model.predict(image)
    File "C:\Python37\lib\site-packages\keras\engine\training.py", line 1452, in predict
    if self._uses_dynamic_learning_phase():
    File "C:\Python37\lib\site-packages\keras\engine\training.py", line 382, in _uses_dynamic_learning_phase
    not isinstance(K.learning_phase(), int))
    File "C:\Python37\lib\site-packages\keras\backend\tensorflow_backend.py", line 73, in symbolic_fn_wrapper
    if _SYMBOLIC_SCOPE.value:
    AttributeError: '_thread._local' object has no attribute 'value'
    127.0.0.1 - - [27/Feb/2020 17:25:35] "[35m[1mPOST /predict HTTP/1.1[0m" 500 -

    больше мне нечего не писал
  • Бот выдает ошибку: json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0). как исправить?

    @zeni1agent Автор вопроса
    Владимир Куц, А где их искать сам сервер кроме

    python C:\Users\user\Desktop\simple-keras-rest-api-master\simple-keras-rest-api-master\run_keras_server.py

    C:\WINDOWS\system32>python C:\Users\user\Desktop\simple-keras-rest-api-master\simple-keras-rest-api-master\run_keras_server.py
    Using TensorFlow backend.
    2020-02-27 17:22:58.468183: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cudart64_101.dll'; dlerror: cudart64_101.dll not found
    2020-02-27 17:22:58.474047: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
    * Loading Keras model and Flask starting server...please wait until server has fully started
    2020-02-27 17:23:14.418136: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library nvcuda.dll
    2020-02-27 17:23:15.076804: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1555] Found device 0 with properties:
    pciBusID: 0000:01:00.0 name: GeForce GT 525M computeCapability: 2.1
    coreClock: 1.2GHz coreCount: 2 deviceMemorySize: 1.00GiB deviceMemoryBandwidth: 26.82GiB/s
    2020-02-27 17:23:15.089234: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cudart64_101.dll'; dlerror: cudart64_101.dll not found
    2020-02-27 17:23:15.099531: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cublas64_10.dll'; dlerror: cublas64_10.dll not found
    2020-02-27 17:23:15.109041: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cufft64_10.dll'; dlerror: cufft64_10.dll not found
    2020-02-27 17:23:15.118869: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'curand64_10.dll'; dlerror: curand64_10.dll not found
    2020-02-27 17:23:15.127996: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cusolver64_10.dll'; dlerror: cusolver64_10.dll not found
    2020-02-27 17:23:15.137769: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cusparse64_10.dll'; dlerror: cusparse64_10.dll not found
    2020-02-27 17:23:15.147974: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cudnn64_7.dll'; dlerror: cudnn64_7.dll not found
    2020-02-27 17:23:15.153373: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1592] Cannot dlopen some GPU libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at https://www.tensorflow.org/install/gpu for how to download and setup the required libraries for your platform.
    Skipping registering GPU devices...
    2020-02-27 17:23:15.168159: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1096] Device interconnect StreamExecutor with strength 1 edge matrix:
    2020-02-27 17:23:15.172543: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1102]
    * Serving Flask app "run_keras_server" (lazy loading)
    * Environment: production
    WARNING: This is a development server. Do not use it in a production deployment.
    Use a production WSGI server instead.
    * Debug mode: off
    * Running on 127.0.0.1:5000 (Press CTRL+C to quit)
  • Бот выдает ошибку: json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0). как исправить?

    @zeni1agent Автор вопроса
    а после запуска бота сервер выводит такое

    [2020-02-27 17:25:35,908] ERROR in app: Exception on /predict [POST]
    Traceback (most recent call last):
    File "C:\Python37\lib\site-packages\flask\app.py", line 2446, in wsgi_app
    response = self.full_dispatch_request()
    File "C:\Python37\lib\site-packages\flask\app.py", line 1951, in full_dispatch_request
    rv = self.handle_user_exception(e)
    File "C:\Python37\lib\site-packages\flask\app.py", line 1820, in handle_user_exception
    reraise(exc_type, exc_value, tb)
    File "C:\Python37\lib\site-packages\flask\_compat.py", line 39, in reraise
    raise value
    File "C:\Python37\lib\site-packages\flask\app.py", line 1949, in full_dispatch_request
    rv = self.dispatch_request()
    File "C:\Python37\lib\site-packages\flask\app.py", line 1935, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
    File "C:\Users\admwi\Desktop\simple-keras-rest-api-master\simple-keras-rest-api-master\run_keras_server.py", line 61, in predict
    preds = model.predict(image)
    File "C:\Python37\lib\site-packages\keras\engine\training.py", line 1452, in predict
    if self._uses_dynamic_learning_phase():
    File "C:\Python37\lib\site-packages\keras\engine\training.py", line 382, in _uses_dynamic_learning_phase
    not isinstance(K.learning_phase(), int))
    File "C:\Python37\lib\site-packages\keras\backend\tensorflow_backend.py", line 73, in symbolic_fn_wrapper
    if _SYMBOLIC_SCOPE.value:
    AttributeError: '_thread._local' object has no attribute 'value'
    127.0.0.1 - - [27/Feb/2020 17:25:35] "[35m[1mPOST /predict HTTP/1.1[0m" 500 -
  • Бот выдает ошибку: json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0). как исправить?

    @zeni1agent Автор вопроса
    KERAS_REST_API_URL = "localhost:5000/predict"
    такая строка у меня есть
    При запуске сервера keras выводит сообщение

    python C:\Users\user\Desktop\simple-keras-rest-api-master\simple-keras-rest-api-master\run_keras_server.py

    C:\WINDOWS\system32>python C:\Users\user\Desktop\simple-keras-rest-api-master\simple-keras-rest-api-master\run_keras_server.py
    Using TensorFlow backend.
    2020-02-27 17:22:58.468183: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cudart64_101.dll'; dlerror: cudart64_101.dll not found
    2020-02-27 17:22:58.474047: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
    * Loading Keras model and Flask starting server...please wait until server has fully started
    2020-02-27 17:23:14.418136: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library nvcuda.dll
    2020-02-27 17:23:15.076804: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1555] Found device 0 with properties:
    pciBusID: 0000:01:00.0 name: GeForce GT 525M computeCapability: 2.1
    coreClock: 1.2GHz coreCount: 2 deviceMemorySize: 1.00GiB deviceMemoryBandwidth: 26.82GiB/s
    2020-02-27 17:23:15.089234: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cudart64_101.dll'; dlerror: cudart64_101.dll not found
    2020-02-27 17:23:15.099531: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cublas64_10.dll'; dlerror: cublas64_10.dll not found
    2020-02-27 17:23:15.109041: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cufft64_10.dll'; dlerror: cufft64_10.dll not found
    2020-02-27 17:23:15.118869: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'curand64_10.dll'; dlerror: curand64_10.dll not found
    2020-02-27 17:23:15.127996: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cusolver64_10.dll'; dlerror: cusolver64_10.dll not found
    2020-02-27 17:23:15.137769: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cusparse64_10.dll'; dlerror: cusparse64_10.dll not found
    2020-02-27 17:23:15.147974: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cudnn64_7.dll'; dlerror: cudnn64_7.dll not found
    2020-02-27 17:23:15.153373: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1592] Cannot dlopen some GPU libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at https://www.tensorflow.org/install/gpu for how to download and setup the required libraries for your platform.
    Skipping registering GPU devices...
    2020-02-27 17:23:15.168159: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1096] Device interconnect StreamExecutor with strength 1 edge matrix:
    2020-02-27 17:23:15.172543: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1102]
    * Serving Flask app "run_keras_server" (lazy loading)
    * Environment: production
    WARNING: This is a development server. Do not use it in a production deployment.
    Use a production WSGI server instead.
    * Debug mode: off
    * Running on 127.0.0.1:5000 (Press CTRL+C to quit)
  • Бот выдает ошибку: json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0). как исправить?

    @zeni1agent Автор вопроса
    По идеи код должен обрабатывать изображение с помощью нейронной сети модифицируя его и после выводить результат в сообщении в таком формате
    https://api.telegram.org/file/bot1067228659:AAHYjLiwxqdTUQwVbgq6IlqFuYZQ4T_d49M/photos/file_10028.jpg

    bot.reply_to(message, 'something fails...') - не делайте так никогда, в смысле в разных участках кода

    Я очень сильно согласен с вами но этот код писал не я. Мне просто было любопытно что он делает и как обрабатывает изображение. Но запустить его оказалось еще той задачей для меня.
  • Бот выдает ошибку: json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0). как исправить?

    @zeni1agent Автор вопроса
    вернул


    500 Internal Server Error
    Internal Server Error
    The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.

    во втором файле
    AttributeError: '_thread._local' object has no attribute 'value'
  • Бот выдает ошибку: json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0). как исправить?

    @zeni1agent Автор вопроса
    Hiccup Heddok,
    Вернул

    500 Internal Server Error
    Internal Server Error
    The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.

    во втором файле
    AttributeError: '_thread._local' object has no attribute 'value'
  • Что вызывает ошибку в боте?

    @zeni1agent Автор вопроса
    Но когда я убираю try в строке if r['success']: возникает ошибка
    line 63, in answer_photo if r['success']: TypeError: 'Response' object is not subscriptable
  • Почему бот выдает ошибку No such file or directory: 'temp/?

    @zeni1agent Автор вопроса
    Сергей Карбивничий, Вроде бы все заработало но изображение почему то не обработалось. по идеи бот должен был мне вернуть обработанное изображение. https://api.telegram.org/file/bot1067228659:AAHYjL...
  • Почему бот выдает ошибку No such file or directory: 'temp/?

    @zeni1agent Автор вопроса
    Сергей Карбивничий, Я добавил такой код
    import time
    import telebot
    import requests
    
    import os
    
    if not os.path.exists('temp'):
        os.makedirs('temp')

    но мне выдает ошибку.
    requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
    я что то неправильно сделал?
  • Почему бот выдает ошибку No such file or directory: 'temp/?

    @zeni1agent Автор вопроса
    Сергей Карбивничий,
    1 Я запускаю скрипт через консоль с помощью команды. python C:\persoml-master\tbot.py
    2 запускаю его в telegram с помощью команды /star бот возвращает мне Hey Start .
    3 после я отправляю файл test.jpg как фото
    4 бот вылетает с ошибкой. 'line 28 No such file or directory: 'temp/86f7181e-cef6-4809-b61c-e61df0f43fc9.png'.
    OC win10
    Python 3.7.6