GithubHelp home page GithubHelp logo

awesome-archive / webgo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zliu1022/webgo

0.0 1.0 0.0 18.21 MB

Using web browser connect leela zero to analyze game go anywhere

License: GNU Affero General Public License v3.0

Python 22.92% HTML 3.50% JavaScript 67.31% CSS 6.27%

webgo's Introduction

Webgo

Introduction

Using web browser to visit your computer which is running leela zero to analyse sgf. So you can analyse all kifu anywhere.

screenshot

Dependency and acknowledge

  1. Web page based on WGo.js.
  2. Server side based on Leela Analysis Scripts and using python2.7
  3. Server side also need Python module: bottle, gevent, gevent-websocket
  4. Using some sabaki theme

Server Installation

  1. Install python 2.7
  2. Install bottle, gevent, gevent-websocket
pip bottle
pip gevent
pip gevent-websocket
  1. If you already have your web server, please skip this step

As an alternate web server solution, you can do several step:

cd webgo
python -m SimpleHTTPServer

3.1 download nginx/1.2.8

3.2 modify nginx.conf and set the port and root path

server {
        listen       80;
        server_name  localhost;
        charset utf-8;
        location = / {
            root   C:\web;
            index  index.html index.php;
}

3.3 add sgf as one filetype permitted by server

location ~* \.(htm|html|gif|jpg|jpeg|png|css|js|ico|json|net|sgf)$ {
    root C:\web;
}
  1. put all zip content to your web site root

In the example , it's c:\web

Server Configuration

In svr\webgo.py, change to your own leelazero executable path and set the weight name correctly and make sure the leelaz.exe support lz-analyze gtp command

executable = "c:/go/leela-zero/leelaz.exe"
weight = '-wc:/go/weight/62b5417b64c46976795d10a6741801f15f857e5029681a42d02c9852097df4b9.gz'

Sgf library

You can put sgf file under sgf directory

How to run

server side, under cmd.exe run:

c:\python2.7\python webgo.py

browser side, can use pad/phone with any web browser

http://your_ip/webgo.html?sgf=1.sgf&move=50

Using Webgo server in mac

  1. Install brew using ruby
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  1. git clone branch
git clone -b next https://github.com/gcp/leela-zero.git
  1. install boost
brew install boost
  1. Compile leelaz with boardsize 9 or 19
  2. using curl -O or ftp to get weight
  3. full-tuner
  4. install pip, bottle, gevent, gevent-websocket
sudo easy_install pip
sudo pip install bottle
pip install --user greenlet
pip install --user gevent
pip install --user gevent-websocket

If failed, maybe need to install pyenv, then using pyenv to install another version python pyenv global 2.7.11 to switch version, but wish you lucky

License

The code is released under the AGPLv3 or later.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.