foliate: eBook viewer

Project description
A simple and modern eBook viewer for Linux desktops
Metadata

homepage URL: https://johnfactotum.github.io/foliate/
source URL: https://johnfactotum.github.io/foliate/
license: bsd
platforms: linux

I have started this here in my NUR repository: https://github.com/nagy/nur-packages/blob/foliate/pkgs/foliate/default.nix
However, I am getting this error when starting the binary:
(.com.github.johnfactotum.Foliate-wrapped:29964): Gjs-CRITICAL **: 14:31:50.457: JS ERROR: ImportError: No JS module 'main' found in search path
@/nix/store/ln5all7k93hpw1plxawq996r1rkiwvcs-foliate-2.5.0/bin/.com.github.johnfactotum.Foliate-wrapped:9:1

(.com.github.johnfactotum.Foliate-wrapped:29964): Gjs-CRITICAL **: 14:31:50.457: Script /nix/store/ln5all7k93hpw1plxawq996r1rkiwvcs-foliate-2.5.0/bin/.com.github.johnfactotum.Foliate-wrapped threw an exception

This might be, that the derivation right now does not install a lib directory. But I dont know how to fix it.

I have started this here in my NUR repository: https://github.com/nagy/nur-packages/blob/foliate/pkgs/foliate/default.nix
However, I am getting this error when starting the binary:
(.com.github.johnfactotum.Foliate-wrapped:29964): Gjs-CRITICAL **: 14:31:50.457: JS ERROR: ImportError: No JS module 'main' found in search path
@/nix/store/ln5all7k93hpw1plxawq996r1rkiwvcs-foliate-2.5.0/bin/.com.github.johnfactotum.Foliate-wrapped:9:1

(.com.github.johnfactotum.Foliate-wrapped:29964): Gjs-CRITICAL **: 14:31:50.457: Script /nix/store/ln5all7k93hpw1plxawq996r1rkiwvcs-foliate-2.5.0/bin/.com.github.johnfactotum.Foliate-wrapped threw an exception

This might be, that the derivation right now does not install a lib directory. But I dont know how to fix it.

@anonimasusan you mention that the license is bsd. But it looks like it is gpl3: https://github.com/johnfactotum/foliate/blob/master/COPYING

@anonimasusan you mention that the license is bsd. But it looks like it is gpl3: https://github.com/johnfactotum/foliate/blob/master/COPYING

Am I wrong or it is a Javascript program?

Yes I think it is javascript.
On Wed, 17 Mar 2021, Anderson Torres wrote:

Am I wrong or it is a Javascript program?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or
unsubscribe.[ASLNGO5YLBF7JWGEJC443HLTEF7EPA5CNFSM4VUQWMV2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOF7D3DEQ.gif]

@nagy I have found a similar issue  #31168 with Gnome characters app.
I was able to successfully build and launch the app with the following build, notice that there was missing webkitgtk:
{ stdenv, fetchFromGitHub, meson, gettext, glib, gjs, ninja, python3, gtk3, webkitgtk
, gsettings-desktop-schemas, wrapGAppsHook, desktop-file-utils
, gobject-introspection }:

stdenv.mkDerivation rec {
  pname = "foliate";
  version = "2.6.2";

  src = fetchFromGitHub {
    owner = "johnfactotum";
    repo = pname;
    rev = version;
    sha256 = "00y08564lim3107bm6b1qdayldj92q7pvhks1824y2j06crxkyw5";
  };

  nativeBuildInputs =
    [ meson ninja python3 wrapGAppsHook ];

  postPatch = ''
    patchShebangs build-aux/meson/postinstall.py
  '';

  postFixup = ''
    echo "fixing wrapper"
    sed -i "1 a imports.package._findEffectiveEntryPointName = () => 'com.github.johnfactotum.Foliate';" $out/bin/.com.github.johnfactotum.Foliate-wrapped
  '';

  buildInputs = [
    gettext
    glib
    gjs
    gtk3
    webkitgtk
    desktop-file-utils
    gobject-introspection
    gsettings-desktop-schemas
  ];

  meta = with stdenv.lib; {
    description = "A simple and modern GTK eBook reader";
    homepage = "https://johnfactotum.github.io/foliate/";
    license = licenses.gpl3;
  };
}

If there's a person who has just a little bit more experience with gnome than me, the PR is very welcome, as the app is quite good actually.

thanks @PanAeon , I can also get it to start and I have updated my branch with your code as well.

This is now available.


Added scope option to Observer

In this example PG the name of MyObject will be printed to the console:
http://playground.babylonjs.com/#012I9K

Wonderful


Pull request issue

I created a pull request that had a couple PSR standard issues. I fixed those issues but when I pushed up the changes, the tests on Travis did not run. I asked this question in the PR but I am not getting a response so I thought I would create an issue in hopes that someone sees this. I have only worked with repos that used Travis a couple times but when I have, the tests ran automatically whenever I pushed up a change. Is there something that I need to do here to get them to run again? If not, could you take a look at it and see what needs to be done with the PR? Thanks!!

So I decided to try adding a minor change and committing that to trigger the tests again and that seemed to work and the tests passed.


Early stopping with MAPE wrongly chooses the worst iteration as best_iteration

On Xgboost python library (version 1.4.2), early-stopping with MAPE should choose an iteration with the minimum MAPE value, however it actually chooses an iteration with the maximum MAPE value.
Code to reproduce:
from sklearn.datasets import load_boston
from sklearn.model_selection import train_test_split
import xgboost as xgb

boston = load_boston()
X_train, X_val, y_train, y_val = train_test_split(boston.data, boston.target, train_size = 0.7, test_size = 0.3)

# MAPE - wrongly choose the best iteration
m = xgb.XGBRegressor(n_estimators=100)
m.fit(X_train, y_train, eval_set=[(X_val, y_val)], eval_metric=["mape"], early_stopping_rounds=5, verbose=100)

print(m.evals_result())

print(f"Best iteration: {m.best_iteration}")
print(f"Best score: {m.best_score}")

Output:
[0]	validation_0-mape:0.67114
[5]	validation_0-mape:0.14712
{'validation_0': OrderedDict([('mape',
               [0.671135, 0.474162, 0.327384, 0.237696, 0.181148, 0.147122])])}
Best iteration: 0
Best score: 0.671135

Expected behaviour:
The best iteration should be 12, and the best score should be 0.108408

FYI, MAE works as expected
m = xgb.XGBRegressor(random_state=RANDOM_STATE, n_estimators=100)
m.fit(X_train, y_train, eval_set=[(X_val, y_val)], eval_metric=["mae"], early_stopping_rounds=5, verbose=100)

display(m.evals_result())

print(f"Best iteration: {m.best_iteration}")
print(f"Best score: {m.best_score}")

[0]	validation_0-mae:14.64539
[16]	validation_0-mae:2.13623
{'validation_0': OrderedDict([('mae',
               [14.645389, 10.471585, 7.387609, 5.4029, 4.108713, 3.289811, 2.826038, 2.552973, 2.387561, 2.284148, 2.188257, 2.146002, 2.102969, 2.112112, 2.121383, 2.143024, 2.136234, 2.120595])])}
Best iteration: 12
Best score: 2.102969

Thanks for reporting, I will look into it later today.  At the moment, could you try passing a customized EarlyStopping callback and specify its `maximize parameter?

Thank you!


AssertionError: tensor([172.5300, 795.3013, 173.0343, 795.1953])

❓ Questions and Help
When I trained the mask-rcnn with my dataset, I got a unexpected error like the title in the 92620 iteration. I prepared my dataset with coco-style.
The error:
2019-05-07 23:39:24,612 maskrcnn_benchmark.trainer INFO: eta: 4 days, 19:31:34  iter: 92520  loss: 0.1519 (0.2161)  loss_classifier: 0.0421 (0.0560)  loss_box_reg: 0.0192 (0.0351)  loss_mask: 0.0809 (0.1112)  loss_objectness: 0.0010 (0.0053)  loss_rpn_box_reg: 0.0029 (0.0086)  time: 0.6952 (0.6628)  data: 0.0066 (0.0081)  lr: 0.002500  max mem: 2653
2019-05-07 23:39:38,111 maskrcnn_benchmark.trainer INFO: eta: 4 days, 19:31:27  iter: 92540  loss: 0.1478 (0.2161)  loss_classifier: 0.0384 (0.0560)  loss_box_reg: 0.0201 (0.0351)  loss_mask: 0.0848 (0.1111)  loss_objectness: 0.0009 (0.0053)  loss_rpn_box_reg: 0.0036 (0.0086)  time: 0.6888 (0.6628)  data: 0.0067 (0.0081)  lr: 0.002500  max mem: 2653
2019-05-07 23:39:50,748 maskrcnn_benchmark.trainer INFO: eta: 4 days, 19:30:58  iter: 92560  loss: 0.1157 (0.2160)  loss_classifier: 0.0238 (0.0560)  loss_box_reg: 0.0128 (0.0350)  loss_mask: 0.0702 (0.1111)  loss_objectness: 0.0010 (0.0053)  loss_rpn_box_reg: 0.0018 (0.0086)  time: 0.6425 (0.6628)  data: 0.0048 (0.0081)  lr: 0.002500  max mem: 2653
2019-05-07 23:40:04,297 maskrcnn_benchmark.trainer INFO: eta: 4 days, 19:30:52  iter: 92580  loss: 0.1641 (0.2160)  loss_classifier: 0.0363 (0.0560)  loss_box_reg: 0.0217 (0.0350)  loss_mask: 0.0885 (0.1111)  loss_objectness: 0.0010 (0.0053)  loss_rpn_box_reg: 0.0037 (0.0086)  time: 0.6855 (0.6628)  data: 0.0062 (0.0081)  lr: 0.002500  max mem: 2653
2019-05-07 23:40:17,301 maskrcnn_benchmark.trainer INFO: eta: 4 days, 19:30:32  iter: 92600  loss: 0.1428 (0.2159)  loss_classifier: 0.0278 (0.0560)  loss_box_reg: 0.0150 (0.0350)  loss_mask: 0.0845 (0.1111)  loss_objectness: 0.0005 (0.0053)  loss_rpn_box_reg: 0.0026 (0.0086)  time: 0.6580 (0.6628)  data: 0.0054 (0.0081)  lr: 0.002500  max mem: 2653
2019-05-07 23:40:30,868 maskrcnn_benchmark.trainer INFO: eta: 4 days, 19:30:27  iter: 92620  loss: 0.1557 (0.2159)  loss_classifier: 0.0408 (0.0560)  loss_box_reg: 0.0156 (0.0350)  loss_mask: 0.0839 (0.1111)  loss_objectness: 0.0003 (0.0053)  loss_rpn_box_reg: 0.0026 (0.0086)  time: 0.6612 (0.6628)  data: 0.0064 (0.0081)  lr: 0.002500  max mem: 2653

Traceback (most recent call last):
  File "tools/train_net.py", line 186, in <module>
    main()
  File "tools/train_net.py", line 179, in main
    model = train(cfg, args.local_rank, args.distributed)
  File "tools/train_net.py", line 85, in train
    arguments,
  File "/home/lmy/mask_rcnn/maskrcnn-benchmark/maskrcnn_benchmark/engine/trainer.py", line 67, in do_train
    loss_dict = model(images, targets)
  File "/home/lmy/anaconda3/envs/maskrcnn_benchmark/lib/python3.6/site-packages/torch/nn/modules/module.py", line 493, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/lmy/anaconda3/envs/maskrcnn_benchmark/lib/python3.6/site-packages/apex-0.1-py3.6-linux-x86_64.egg/apex/amp/_initialize.py", line 194, in new_fwd
    **applier(kwargs, input_caster))
  File "/home/lmy/mask_rcnn/maskrcnn-benchmark/maskrcnn_benchmark/modeling/detector/generalized_rcnn.py", line 52, in forward
    x, result, detector_losses = self.roi_heads(features, proposals, targets)
  File "/home/lmy/anaconda3/envs/maskrcnn_benchmark/lib/python3.6/site-packages/torch/nn/modules/module.py", line 493, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/lmy/mask_rcnn/maskrcnn-benchmark/maskrcnn_benchmark/modeling/roi_heads/roi_heads.py", line 39, in forward
    x, detections, loss_mask = self.mask(mask_features, detections, targets)
  File "/home/lmy/anaconda3/envs/maskrcnn_benchmark/lib/python3.6/site-packages/torch/nn/modules/module.py", line 493, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/lmy/mask_rcnn/maskrcnn-benchmark/maskrcnn_benchmark/modeling/roi_heads/mask_head/mask_head.py", line 77, in forward
    loss_mask = self.loss_evaluator(proposals, mask_logits, targets)
  File "/home/lmy/mask_rcnn/maskrcnn-benchmark/maskrcnn_benchmark/modeling/roi_heads/mask_head/loss.py", line 112, in __call__
    labels, mask_targets = self.prepare_targets(proposals, targets)
  File "/home/lmy/mask_rcnn/maskrcnn-benchmark/maskrcnn_benchmark/modeling/roi_heads/mask_head/loss.py", line 94, in prepare_targets
    segmentation_masks, positive_proposals, self.discretization_size
  File "/home/lmy/mask_rcnn/maskrcnn-benchmark/maskrcnn_benchmark/modeling/roi_heads/mask_head/loss.py", line 36, in project_masks_on_boxes
    cropped_mask = segmentation_mask.crop(proposal)
  File "/home/lmy/mask_rcnn/maskrcnn-benchmark/maskrcnn_benchmark/structures/segmentation_mask.py", line 481, in crop
    cropped_instances = self.instances.crop(box)
  File "/home/lmy/mask_rcnn/maskrcnn-benchmark/maskrcnn_benchmark/structures/segmentation_mask.py", line 385, in crop
    cropped_polygons.append(polygon.crop(box))
  File "/home/lmy/mask_rcnn/maskrcnn-benchmark/maskrcnn_benchmark/structures/segmentation_mask.py", line 249, in crop
    assert xmin <= xmax and ymin <= ymax, str(box)
AssertionError: tensor([172.5300, 795.3013, 173.0343, 795.1953])

I only have 2-bit segmentation labels at the beginning, and I use the following code transform my label to the coco-style polygon segmentation and bbox:
def xmerge(a, b):
    alen, blen = len(a), len(b)
    mlen = min(alen, blen)
    for i in range(mlen):
        yield a[i]
        yield b[i]

def Subtraction(x):
    if x < 1 :
        return 0
    else:
        return (x-1)

def get_outline_(label_tif_path):
    # 这个函数用来得到每张图片的各个object的轮廓
    # label_tif_path：标记图片的路径
    img = io.imread(label_tif_path)  # 打开标记二值图片
    BLACK = [0, 0, 0]
    constant = cv2.copyMakeBorder(img, 1, 1, 1, 1, cv2.BORDER_CONSTANT, value=BLACK)
    contours = measure.find_contours(constant, 125)  # 获得连通域轮廓
    i = 0  # 计数
    dict_pos = {} # 存放object的信息

    for each in contours:  # 遍历每一个object的轮廓
        dict_position = [i for i in xmerge(list(map(Subtraction,each[:, 1])), list(map(Subtraction,each[:, 0])))]
        dict_pos[i] = dict_position
        i += 1  # 计数 加1

    return dict_pos

def get_boxes(label_tif_path):
    img = io.imread(label_tif_path)  # 打开标记二值图片
    BLACK = [0, 0, 0]
    constant = cv2.copyMakeBorder(img, 1, 1, 1, 1, cv2.BORDER_CONSTANT, value=BLACK)
    contours = measure.find_contours(constant, 125)  # 获得连通域轮廓
    i = 0  # 计数
    dict_id = {}  # 存放object的信息
    for each in contours:  # 遍历每一个object的轮廓
        dict_position = [0]*4 # 存放每一个object的信息
        dict_position[0]=min(list(map(Subtraction,each[:, 1]))) # x_min
        dict_position[1]=min(list(map(Subtraction,each[:, 0])))  # y_min
        dict_position[2] = max(list(map(Subtraction,each[:, 1])))# x_max
        dict_position[3] = max(list(map(Subtraction,each[:, 0])))# y_max
        dict_id[i]= dict_position
        i+=1
    return i,dict_id

Is it the result of mistakes in my label conversion process? please help me, thank you!

does this problem solved? our data appeared the same error.

@ccxu no, I haven't. The code for label conversion worked well in a dataset and the error didn't appeared. But the error occured in the other dataset with the same code for label conversion...

hi, does the problem solved? I also meet this problem when training using my data, but it occurs during a certain step. is it because the label error?

No, I haven't solved. I don't know what go wrong. So, I changed to use another code and the same label. everything is working fine.
------------------ 原始邮件 ------------------
发件人<EMAIL_ADDRESS>发送时间: 2019年9月4日(星期三) 上午10:15
收件人<EMAIL_ADDRESS>抄送: "＼ 淰、笑<EMAIL_ADDRESS><EMAIL_ADDRESS>主题: Re: [facebookresearch/maskrcnn-benchmark] AssertionError:tensor([172.5300, 795.3013, 173.0343, 795.1953]) (#759)
hi, does the problem solved? I also meet this problem when training using my data, but it occurs during a certain step. is it because the label error?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@lmybaobao @ccxu @Redaimao Hi, guys, I meet the same problem today. I figure out the reason is  the bbox labels I loaded into the model is wrong, which means 'xmin > xmax and ymin > ymax'. It may caused by error labels of the data set. Also, it may caused by the processing of the image and labels, for example, when you rotate the image and the label, the label may let min and max values in wrong positions.
My problem may not be same as yours, but I hope it can give you some sprite.

I got the same issue. According to File "/home/lmy/mask_rcnn/maskrcnn-benchmark/maskrcnn_benchmark/modeling/roi_heads/mask_head/loss.py", line 36, in project_masks_on_boxes     cropped_mask = segmentation_mask.crop(**proposal**), it seems this comes from the model proposals, other than our data label error?


Fix Split Navbar

At the moment, the Navbar content is split based on page width, which doesn't look good for longer navbar items ("Code of Conduct").

do you want to to just fix the padding, or make a drop down menu for smaller screens hiding the navbar?
so it would be:
navbar fits? navbar
navbar doesn't fit? convert to menu bar
something like this: https://css-tricks.com/convert-menu-to-dropdown/


About the scale position such as canonical-face-model?

How can I adjust the size and position of the model? I have added the reference model to the scene and anchored it to the tip of the nose. How can I make adjustments? Alternatively, can I align the global and facial features without setting an anchor? Thank you.
<a-assets>
      <a-asset-item id="headModel" src="canonical-face-model.glb" ></a-asset-item>
      </a-assets>
      <a-camera active="false" position="0 0 0"></a-camera>
      <a-entity mindar-face-target="anchorIndex: 1">
        <a-gltf-model  rotation="0 0 0" position="0 0 0" scale="1 1 1" " src="#headModel"></a-gltf-model>
        </a-entity>

the model appears too large and its position is incorrect.....

update rotation="0 0 0" position="0 0 0" scale="1 1 1"

update rotation="0 0 0" position="0 0 0" scale="1 1 1"

I have already set the position,
<a-gltf-model  rotation="0 0 0" position="0 0 0" scale="1 1 1" " src="#headModel"></a-gltf-model>
do you mean I need to create a script to update the model's position?

adjust the values if you want to move/rescale.


Fix package management error during xenial, wily setup

"Error: Package gnome-session-fallback has no installation candidate" ― then a note that it has been replaced with gnome-session-flashback, so proposing a change to target script to reflect this

Greetings @StrawnPoint04 , seems we both have tried the same thing, a delayed response on my part to a referenced ticket, but I think you should give #1689 a look. Unfortunately gnome-session-flashback does not exist prior to trusty, wheezy or kali, so any distros that are mentioned on the crouton list, would break. In there I have one possible work-around pending.

Committed new code to the pull request to solve the Catch-22 that @Voronsky brought up

Since the only way I could possibly keep my fork up-to-date was to delete and recreate it, code to merge is here.

Just to clarify, this is the exact same fix as what was intended in #1689, right?
This one LGTM, I'm not sure what happened to the other (github interface says there are a lot of modified files)...

@drinkcat seems the solution here is the same I have pending in #1689, both are showing what should be added to fix the issue.

I think this is the only issue that's stopping someone from using gnome on xenial. I tried using the new code in a custom target and it installed successfully but wasn't able to actually run it because it kept saying No chroots with target 'gnome'. If this is merged, I think it will work!
Thanks.

Can someone explain step by step how to change the fallback to flashback so I can install xenial gnome, I changed it on the zip file but I don't know where to go from there. @Voronsky 's post and this one don't make sense to me. Please and thank you guys!

No one has merged this pull request yet ― why? Bug still is causing problems.

@SoccerPie,
The idea is to replace gnome-session-fallback with gnome-session-flashback for newer releases.
However not all releases use it so conditional tests have to be done to apply it, the pull requests haven't been reviewed and merged yet.
However, you can run the crouton install script and when it fails, edit a script to fix it.
Take a look at https://github.com/dnschneid/crouton/issues/1706#issuecomment-104463165 for more details, it's using the 'vivid' release but the same applies to the 'xenial' release.
Once you've edited the script, just re-enter the chroot using enter-chroot and let the setup script finish.
Hope this helps,
-DennisL

@StrawnPoint04 there's a pending review item for you (not sure why it didn't show up in the log here).

Tracking in #2818


[Missing SNMP Polling Profile]

Device Vendor: Cisco Inc.
Device Model: Switch and Router
Please add to the current profile.
System Object Identifier (SysOID):
.<IP_ADDRESS>.<IP_ADDRESS>.1041
.<IP_ADDRESS>.<IP_ADDRESS>.957
.<IP_ADDRESS>.<IP_ADDRESS>.525
.<IP_ADDRESS>.<IP_ADDRESS>.987
.<IP_ADDRESS>.<IP_ADDRESS>.558
.<IP_ADDRESS>.<IP_ADDRESS>.1352
.<IP_ADDRESS>.<IP_ADDRESS>.1353
.<IP_ADDRESS>.<IP_ADDRESS>.2530
.<IP_ADDRESS>.<IP_ADDRESS>.963
.<IP_ADDRESS>.<IP_ADDRESS>.1620
.<IP_ADDRESS>.<IP_ADDRESS>.1751
.<IP_ADDRESS>.<IP_ADDRESS>.2961
.<IP_ADDRESS>.<IP_ADDRESS>.1756
.<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>0

Hey Husain,
I was able to get most of those objects rolled in to our existing profiles but there were a few that are new entity types for us that we are going to need you to provide SNMP walks from to be sure we get the profile correct.  If you could get us a full walk from one of each of these device types we can get that done.
.<IP_ADDRESS>.<IP_ADDRESS>.<IP_ADDRESS>0      # Cisco DSC9396 Fiber Channel Switch
.<IP_ADDRESS>.<IP_ADDRESS>.963      #  Cisco VG204
.<IP_ADDRESS>.<IP_ADDRESS>.558      #  Cisco VG224
Please provide a public gist with a sanitized (sensitive information removed) SNMP walk of the device. Providing MIB files is not a substitute for an SNMP walk and failure to provide one here will result in delays for closing this issue. The output of these commands shows the "true story" of what a device will respond to in SNMP and is used to ensure that our profiles are efficient and accurate for your devices.
Gist Links:

Example SNMP walk commands:
# v2c example
snmpwalk -v 2c -t 10 -On -c $COMMUNITY_STRING $IP_ADDRESS . >> snmp_walk.out

# v3 example
snmpwalk -v3 -t 10 -l authPriv -u $USERNAME -a MD5|SHA -A $AUTH_PASS -x DES|AES -X $PRIV_PASS -ObentU -Cc $IP_ADDRESS . >> snmp_walk.out


eventManager.js better syntax.😎

Hello😘, I replaced the old js classes syntax with new ES syntax.😍✋

@Aslemammad Thanks for your contribution ❤. At first, I wrote it with ES6 Classes, then I changed it to arrow functions & object. I like this syntax. They're kinda the same (Performance-wise). So I guess there's no need for this.
Also, make sure you submit the issue first, then when approved, submit your PR if you want. It prevents unnecessary changes. ❤