stephanecharette / DarkMark

Marking up images for use with Darknet.
https://www.ccoderun.ca/darkmark/Summary.html
Other
160 stars 21 forks source link

Create project from CLI in remote desktop #21

Closed ElHouas closed 2 years ago

ElHouas commented 2 years ago

Hello Stephane, Congratulations for the great package you created. I wanted to ask if it will be possible to create a project and perform data augmentation from the CLI? As I am trying to run DarkMark in a remote machine, but as you mentioned earlier the GUI will not work in a remote desktop.

Thanks!

stephanecharette commented 2 years ago

Why would the GUI not work in a remote desktop? I use it that way all the time.

And yes, there are command-line options for DarkMark. Take a look at the web site.

ElHouas commented 2 years ago

Hey Stephane,

Thanks for asking so quick, really appreciated. I ve been using your tool for a while and from your documentation, I do not see how I could start a new project from command line and apply tiling. Also, I saw that DarkMark uses Juce for the GUI and when connecting remotely using Remmima desktop I cannot interact with the app when launching it. Any advice on that? I would like to apply tiling in my training dataset to improve detection of small objects. Thanks!

stephanecharette commented 2 years ago

What do you mean "start a new project from command line"?

Applying tiling from the CLI is as simple as specifying --tiles on or -T true, as well as several other tiling options such as tile-rect and tile-edge. Run DarkHelp --help to see all options, or see the web site for CLI details. Note you should train your network with tiling enabled for best results.

DarkMark should work fine with remote desktop tools. I know some people use it regularly on remote desktops running on Amazon EC2 instances for example.

stephanecharette commented 2 years ago

Sorry, are you talking about DarkHelp or DarkMark? I thought you were asking about DarkHelp.

To create a new project in DarkMark from the CLI, follow the instructions here: https://www.ccoderun.ca/darkmark/CLI.html

You'll see on that page that one of the options is tile_images=true.

ElHouas commented 2 years ago

Yeah I was talking about DarkMark, as I wanted to apply the data augmentation technique in my training set in order to enhance detection in small objects when applying tiling. I ll check that out, thanks for sharing and the quick response Really appeciated!

ElHouas commented 2 years ago

Screenshot from 2022-06-21 17-40-26 When i load the project from CLI through ssh, it pops up the GUI empty and I am not able to interact. My objective is to create a darkmark_image_cache file from CLI. This is the comman i m running

DarkMark limit_neg_samples=true template=/home/ubuntu/datasets/darknet_results/yolov4_test15/yolo-roco_small.cfg tile_images=true zoom_images=true width=416 height=416 editor=gen-darknet
stephanecharette commented 2 years ago

My guess is you don't have the normal fonts installed. EXACTLY what version of Ubuntu is this?

See the DarkMark souce file src-main/DarkMarkApp.cpp, scroll to around line 200 and see the comment at the top of dm::DarkMarkApplication::initialise(). Try and uncomment a different font line, like one of the Ubuntu ones for example. Or, comment out all of the lines that attempt to change the default font, and see what comes up.

ElHouas commented 2 years ago

Hey Stephane, I ve tried your answer, but unfortuanetly I still have the same behaviour.

That's my ubuntu version:

Distributor ID: Ubuntu
Description:    Ubuntu 20.04.4 LTS
Release:    20.04
Codename:   focal

I ve uncommented the following lines:

Desktop::getInstance().getDefaultLookAndFeel().setDefaultSansSerifTypefaceName("Ubuntu Condensed");
Desktop::getInstance().getDefaultLookAndFeel().setDefaultSansSerifTypefaceName("Ubuntu");

Do you think it could be caused by a conflict in OpenCV? Thanks

stephanecharette commented 2 years ago

1) What edition of Ubuntu? I'm guessing this is not a normal Desktop edition since you don't have the usual fonts. 2) Only 1 of the setDefaultSansSerifTypefaceName() must be used. You cannot uncomment multiple of those lines.

My suggestion is you comment them all out, and let JUCE pick a font. But if you don't have the normal fonts installed, I suspect things won't look any better. You need to make sure you have the usual Desktop fonts installed.

stephanecharette commented 2 years ago

Looking at my 20.04 instance, I see these packages (and many more!) installed when I run commands such as `dpkg -l | grep "fonts-"

ii  xfonts-base                                   1:1.0.5                              all          standard fonts for X
ii  xfonts-encodings                              1:1.0.5-0ubuntu1                     all          Encodings for X.Org fonts
ii  xfonts-scalable                               1:1.0.3-1.1                          all          scalable fonts for X
ii  xfonts-utils                                  1:7.7+6                              amd64        X Window System font utility programs

Do you have all these installed? (And if not...why? How did you end up with an instance that didn't have the normal fonts available?)

stephanecharette commented 2 years ago

DarkMark attempts to use "Liberation Sans" as a font. This is a font that has been installed as part of Ubuntu for many years now. You can try and manually install just that 1 font and see if it makes a difference? Looking at the packages I have, I would guess it is one or both of these:

> dpkg -l | grep "liberation"
ii  fonts-liberation                              1:1.07.4-11                          all          Fonts with the same metrics as Times, Arial and Courier
ii  fonts-liberation2                             2.1.0-1                              all          Fonts with the same metrics as Times, Arial and Courier (v2)

So the command to install would be: sudo apt-get install fonts-liberation fonts-liberation2. Most likely DarkMark only needs 1 of those, but I don't know the difference nor which one is actually necessary.

ElHouas commented 2 years ago

Hi Stephane,

Thanks for the advice, as I've been able to install the font and I can see the options in the main menu. However, I cannot interact with the main window, it seems frozen. Could be an issue with opencv? Any ideas how could I solve it?

Thanks!

stephanecharette commented 2 years ago

You still have not answered my most basic question from over 2 weeks ago:

Do you have all these installed? (And if not...why? How did you end up with an instance that didn't have the normal fonts available?)

I don't know why it isn't working for you. But obviously you have a strange installation. If you told us why your installation is so strange, maybe we could guess as to why it isn't working.

ElHouas commented 2 years ago

Hey stephane,

Sorry for the delay in the response. I have a standard GCP instance with Ubuntu 20.04, I cannot tell why the instance came out without those fonts installed. I ve run the command you suggested. Now, when i type dpkg -l | grep "fonts-" i get this output:

ii  fonts-cantarell                        0.111-2                            all          sans serif font family designed for on-screen readability
ii  fonts-dejavu-core                      2.37-1                             all          Vera font family derivate with additional characters
ii  fonts-dejavu-extra                     2.37-1                             all          Vera font family derivate with additional characters (extra variants)
ii  fonts-droid-fallback                   1:6.0.1r16-1.1                     all          handheld device font with extensive style and language support (fallback)
ii  fonts-liberation                       1:1.07.4-11                        all          Fonts with the same metrics as Times, Arial and Courier
ii  fonts-liberation2                      2.1.0-1                            all          Fonts with the same metrics as Times, Arial and Courier (v2)
ii  fonts-noto-color-emoji                 0~20200916-1~ubuntu20.04.1         all          color emoji font from Google
ii  fonts-noto-mono                        20200323-1build1~ubuntu20.04.1     all          "No Tofu" monospaced font family with large Unicode coverage
ii  fonts-quicksand                        0.2016-2                           all          sans-serif font with round attributes
ii  fonts-ubuntu                           0.83-4ubuntu1                      all          sans-serif font set from Ubuntu
ii  fonts-ubuntu-console                   0.83-4ubuntu1                      all          console version of the Ubuntu Mono font
ii  fonts-urw-base35                       20170801.1-3                       all          font set metric-compatible with the 35 PostScript Level 2 Base Fonts
ii  xfonts-base                            1:1.0.5                            all          standard fonts for X
ii  xfonts-encodings                       1:1.0.5-0ubuntu1                   all          Encodings for X.Org fonts
ii  xfonts-scalable                        1:1.0.3-1.1                        all          scalable fonts for X
ii  xfonts-utils                           1:7.7+6                            amd64        X Window System font utility programs

Thanks for the help

stephanecharette commented 2 years ago
> dpkg -l | grep "fonts-" | wc -l
133
stephanecharette commented 2 years ago

What is "GCP"? Google Cloud? Before I spend any more time on this, please install a normal Canonical Ubuntu instance locally -- in VirtualBox if needed -- and attempt to run it there. Then if it works there (as it should) you can compare this instance to your GCP instance.

ElHouas commented 2 years ago

Hi Stephane,

I solved the issue connecting remotely to the GCP instance (Google Cloud), using their own remote desktop option. I ve been able to create an augmented dataset. Thanks for the time and help