Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
LarvaTagger.jl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nyx
LarvaTagger.jl
Commits
332f599a
Commit
332f599a
authored
3 months ago
by
François LAURENT
Browse files
Options
Downloads
Patches
Plain Diff
feat: remote access with --server-url
parent
aa8e7ce8
No related branches found
No related tags found
1 merge request
!23
Set of commits to be tagged 0.19.1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
scripts/larvatagger
+4
-1
4 additions, 1 deletion
scripts/larvatagger
src/cli_open.jl
+25
-3
25 additions, 3 deletions
src/cli_open.jl
with
29 additions
and
4 deletions
scripts/larvatagger
+
4
−
1
View file @
332f599a
...
@@ -52,7 +52,7 @@ import|merge|--version|-V)
...
@@ -52,7 +52,7 @@ import|merge|--version|-V)
LarvaTagger
LarvaTagger
Usage:
Usage:
larvatagger open [<file-path>] [--backends=<path>] [--port=<number>] [--quiet] [--viewer] [--browser] [--view-factor=<real>] [--manual-label=<label>]
larvatagger open [<file-path>] [--backends=<path>] [--port=<number>]
[--server-url=<url>]
[--quiet] [--viewer] [--browser] [--view-factor=<real>] [--manual-label=<label>]
larvatagger import <input-path> [<output-file>] [--id=<id>] [--framerate=<fps>] [--pixelsize=<μm>] [--overrides=<comma-separated-list>] [--default-label=<label>] [--manual-label=<label>] [--decode] [--copy-labels]
larvatagger import <input-path> [<output-file>] [--id=<id>] [--framerate=<fps>] [--pixelsize=<μm>] [--overrides=<comma-separated-list>] [--default-label=<label>] [--manual-label=<label>] [--decode] [--copy-labels]
larvatagger train <backend-path> <data-path> <model-instance> [--pretrained-model=<instance>] [--labels=<comma-separated-list>] [--sample-size=<N>] [--balancing-strategy=<strategy>] [--class-weights=<csv>] [--manual-label=<label>] [--layers=<N>] [--iterations=<N>] [--seed=<seed>] [--debug]
larvatagger train <backend-path> <data-path> <model-instance> [--pretrained-model=<instance>] [--labels=<comma-separated-list>] [--sample-size=<N>] [--balancing-strategy=<strategy>] [--class-weights=<csv>] [--manual-label=<label>] [--layers=<N>] [--iterations=<N>] [--seed=<seed>] [--debug]
larvatagger train <backend-path> <data-path> <model-instance> --fine-tune=<instance> [--balancing-strategy=<strategy>] [--manual-label=<label>] [--iterations=<N>] [--seed=<seed>] [--debug]
larvatagger train <backend-path> <data-path> <model-instance> --fine-tune=<instance> [--balancing-strategy=<strategy>] [--manual-label=<label>] [--iterations=<N>] [--seed=<seed>] [--debug]
...
@@ -71,6 +71,7 @@ Options:
...
@@ -71,6 +71,7 @@ Options:
--pixelsize=<μm> Camera pixel size, in micrometers.
--pixelsize=<μm> Camera pixel size, in micrometers.
--backends=<path> Path to backend repository.
--backends=<path> Path to backend repository.
--port=<number> Port number the server listens to.
--port=<number> Port number the server listens to.
--server-url=<url> Server address, for remote access.
--viewer Disable editing capabilities.
--viewer Disable editing capabilities.
--browser Automatically open a browser tab at the served location.
--browser Automatically open a browser tab at the served location.
--view-factor=<real> Scaling factor for the larva views; default is 2 on macOS, 1 elsewhere.
--view-factor=<real> Scaling factor for the larva views; default is 2 on macOS, 1 elsewhere.
...
@@ -104,6 +105,8 @@ Commands:
...
@@ -104,6 +105,8 @@ Commands:
The optional positional argument <file-path> can also be the data root directory.
The optional positional argument <file-path> can also be the data root directory.
Backends defined in LarvaTagger project root directory are automatically found. Other
Backends defined in LarvaTagger project root directory are automatically found. Other
backend locations can be specified with the --backends argument.
backend locations can be specified with the --backends argument.
By default, if --server-url is specified, the port is appended to the ip address or
domain name. To prevent this behavior, include the desired port number in the url.
import Generate a label file and store metadata.
import Generate a label file and store metadata.
...
...
This diff is collapsed.
Click to expand it.
src/cli_open.jl
+
25
−
3
View file @
332f599a
...
@@ -9,7 +9,7 @@ export main
...
@@ -9,7 +9,7 @@ export main
usage
=
"""LarvaTagger.jl - launch the server-based GUI.
usage
=
"""LarvaTagger.jl - launch the server-based GUI.
Usage:
Usage:
larvatagger-gui.jl [<file-path>] [--backends=<path>] [--port=<number>] [--quiet] [--viewer] [--browser] [--view-factor=<real>] [--manual-label=<label>]
larvatagger-gui.jl [<file-path>] [--backends=<path>] [--port=<number>]
[--server-url=<url>]
[--quiet] [--viewer] [--browser] [--view-factor=<real>] [--manual-label=<label>]
larvatagger-gui.jl -h | --help
larvatagger-gui.jl -h | --help
Options:
Options:
...
@@ -17,6 +17,7 @@ Options:
...
@@ -17,6 +17,7 @@ Options:
-q --quiet Do not show instructions.
-q --quiet Do not show instructions.
--backends=<path> Path to backend repository.
--backends=<path> Path to backend repository.
--port=<number> Port number the server listens to.
--port=<number> Port number the server listens to.
--server-url=<url> Server address, for remote access.
--viewer Disable editing capabilities.
--viewer Disable editing capabilities.
--browser Automatically open a browser tab at the served location.
--browser Automatically open a browser tab at the served location.
--view-factor=<real> Scaling factor for the larva views; default is 2 on macOS, 1 elsewhere.
--view-factor=<real> Scaling factor for the larva views; default is 2 on macOS, 1 elsewhere.
...
@@ -25,6 +26,9 @@ Options:
...
@@ -25,6 +26,9 @@ Options:
The optional positional argument <file-path> can also be the data root directory.
The optional positional argument <file-path> can also be the data root directory.
Backends defined in LarvaTagger project root directory are automatically found. Other
Backends defined in LarvaTagger project root directory are automatically found. Other
backend locations can be specified with the --backends argument.
backend locations can be specified with the --backends argument.
By default, if --server-url is specified, the port is appended to the ip address or domain
name. To prevent this behavior, include the desired port number in the url.
"""
"""
function
main
(
args
=
ARGS
;
exit_on_error
=
false
)
function
main
(
args
=
ARGS
;
exit_on_error
=
false
)
...
@@ -82,12 +86,30 @@ function main(args=ARGS; exit_on_error=false)
...
@@ -82,12 +86,30 @@ function main(args=ARGS; exit_on_error=false)
#
#
port
=
parsed_args
[
"--port"
]
port
=
parsed_args
[
"--port"
]
port
=
isnothing
(
port
)
?
9284
:
parse
(
Int
,
port
)
port
=
isnothing
(
port
)
?
9284
:
parse
(
Int
,
port
)
server
=
Server
(
app
,
"0.0.0.0"
,
port
)
proxy_url
=
parsed_args
[
"--server-url"
]
if
isnothing
(
proxy_url
)
proxy_url
=
""
elseif
!
startswith
(
proxy_url
,
"http"
)
proxy_url
=
"http://
$(proxy_url)
"
end
server
=
Server
(
app
,
"0.0.0.0"
,
port
;
proxy_url
=
proxy_url
)
port
=
server
.
port
if
!
isempty
(
proxy_url
)
protocol
,
remainder
=
split
(
proxy_url
,
"://"
)
if
!
(
':'
in
remainder
)
server
.
proxy_url
=
proxy_url
=
if
'/'
in
remainder
server_name
,
path
=
split
(
remainder
,
'/'
;
limit
=
2
)
"
$(protocol)
://
$(server_name)
:
$(port)
/
$(path)
"
else
"
$(protocol)
://
$(remainder)
:
$(port)
"
end
end
end
if
parsed_args
[
"--browser"
]
if
parsed_args
[
"--browser"
]
Bonito
.
HTTPServer
.
openurl
(
"http://127.0.0.1:
$(port)
"
)
Bonito
.
HTTPServer
.
openurl
(
"http://127.0.0.1:
$(port)
"
)
end
end
if
verbose
if
verbose
@info
"The server is ready at
http://127.0.0.1:
$(port
)
"
@info
"The server is ready at
$
(Bonito.HTTPServer.online_url(server, "")
)"
end
end
if
verbose
if
verbose
@info
"Press Ctrl+D to stop the server (or Ctrl+C if in PowerShell)"
@info
"Press Ctrl+D to stop the server (or Ctrl+C if in PowerShell)"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment