-
Notifications
You must be signed in to change notification settings - Fork 2
QDeepLandia v1.0.0 #1
base: master
Are you sure you want to change the base?
Conversation
Small comment about the versioning: instead of a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fantastic work, thanks @SebastienPeillet !
I have some minor style comments, as well as a pair of remarks relative to the get_trained_model
function, from the deeposlandia
API, that could be updated here.
I point out some additional points, however we will address them in further PRs; I plan to write some related issues so as to be meticulous.
locale_path = os.path.join( | ||
os.path.dirname(__file__), | ||
'i18n', | ||
'thyrsis_{}.qm'.format(locale)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this file committed?
self.initProcessing() | ||
|
||
self.toolbar = QToolBar(tr("QDeepLandia_toolbar")) | ||
self.toolbar.setObjectName("QDeepLandia_toolbar") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure to understand the difference with the previous line, do you really want both these lines?
|
||
|
||
class DatagenQDeepLandiaProcessingAlgorithm(QgsProcessingAlgorithm): | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docstrings welcomed! :)
|
||
path='' | ||
for i in [dest_path, dataset, 'input','testing','images']: | ||
path = os.path.join(path, i) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
os.path
does not seem very practical in this use case... Maybe we should consider pathlib.Path
(Python3) in the future.
shutil.rmtree(os.path.join(dest_path, dataset, 'preprocessed', str(shape))) | ||
|
||
cmd = ['deepo', 'datagen', '-D', dataset, '-s', str(shape), '-P', dest_path, '-T', '1'] | ||
subprocess.run(cmd) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm kind of puzzled with the call to subprocess
. I'm sure we could use the deeposlandia
API; let's say it's OK there, however it deserves a special issue.
dataset = os.path.basename(os.path.abspath(os.path.join(os.path.dirname(model_path), '..', '..', '..'))) | ||
image_size = os.path.splitext(os.path.basename(model_path))[0].split('-')[-1] | ||
try : | ||
model = get_trained_model(datapath, dataset, int(image_size), int(nb_labels)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same remark as in the datagen.py
module.
5806c54
to
0e5a51a
Compare
First operative version of qdeeplandia.
Long story short :
qdeeplandia.py
contains the plugin main class QDeeplandiaPlugin that :gui
folder stores pop-up windows; so at the moment there is only the windows that ask the number of label handled by the loaded model.processing_provider
is the folder relative to the processing toolbox, it contains :provider.py
, the qdeeplandia processing tool providerdatagen.py
, a processing tool to generate tiles according to the loaded model; for now it used a subprocessdeepo datagen etc etc
, it could be changed to use API in the futureinference.py
, a processing tool to do inference on the current raster layer, this tool use the previous one to generate the tiles.inferenceTask.py
: Inference tool has been wrapped in a QgsTask to avoid to freeze QGIS during the inferenceInstallation
I didn't really care about the installation procedure. But to explain how it works for me :
futhermore there is a config.ini in the qdeeplandia repository, which is needed to initialize deeposlandia, but I believe that it is not used after initialization.