Chima Obi
commited on
Commit
·
8a8eebe
1
Parent(s):
8e5d8c7
Update predict raster function
Browse files- .idea/.gitignore +3 -0
- .idea/Segment_things.iml +14 -0
- .idea/copilot/chatSessions/00000000000.xd +0 -0
- .idea/copilot/chatSessions/blobs/version +0 -0
- .idea/copilot/chatSessions/xd.lck +194 -0
- .idea/inspectionProfiles/Project_Default.xml +24 -0
- .idea/inspectionProfiles/profiles_settings.xml +6 -0
- .idea/misc.xml +4 -0
- .idea/modules.xml +8 -0
- .idea/vcs.xml +6 -0
- semantic-segmentation/SemanticModel/prediction.py +146 -42
.idea/.gitignore
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
# Default ignored files
|
2 |
+
/shelf/
|
3 |
+
/workspace.xml
|
.idea/Segment_things.iml
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<module type="PYTHON_MODULE" version="4">
|
3 |
+
<component name="NewModuleRootManager">
|
4 |
+
<content url="file://$MODULE_DIR$">
|
5 |
+
<excludeFolder url="file://$MODULE_DIR$/venv" />
|
6 |
+
</content>
|
7 |
+
<orderEntry type="inheritedJdk" />
|
8 |
+
<orderEntry type="sourceFolder" forTests="false" />
|
9 |
+
</component>
|
10 |
+
<component name="PyDocumentationSettings">
|
11 |
+
<option name="format" value="PLAIN" />
|
12 |
+
<option name="myDocStringFormat" value="Plain" />
|
13 |
+
</component>
|
14 |
+
</module>
|
.idea/copilot/chatSessions/00000000000.xd
ADDED
Binary file (5.46 kB). View file
|
|
.idea/copilot/chatSessions/blobs/version
ADDED
Binary file (4 Bytes). View file
|
|
.idea/copilot/chatSessions/xd.lck
ADDED
@@ -0,0 +1,194 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Private property of Exodus: [email protected]
|
2 |
+
|
3 |
+
jetbrains.exodus.io.LockingManager.lock(LockingManager.kt:88)
|
4 |
+
jetbrains.exodus.io.LockingManager.lock(LockingManager.kt:39)
|
5 |
+
jetbrains.exodus.io.FileDataWriter.lock(FileDataWriter.kt:70)
|
6 |
+
jetbrains.exodus.log.Log.tryLock(Log.kt:804)
|
7 |
+
jetbrains.exodus.log.Log.<init>(Log.kt:117)
|
8 |
+
jetbrains.exodus.env.Environments.newLogInstance(Environments.kt:117)
|
9 |
+
jetbrains.exodus.env.Environments.newLogInstance(Environments.kt:81)
|
10 |
+
jetbrains.exodus.env.Environments.newLogInstance(Environments.kt:77)
|
11 |
+
jetbrains.exodus.env.Environments$newInstance$4.invoke(Environments.kt:46)
|
12 |
+
jetbrains.exodus.env.Environments$newInstance$4.invoke(Environments.kt:46)
|
13 |
+
jetbrains.exodus.env.Environments.prepare(Environments.kt:120)
|
14 |
+
jetbrains.exodus.env.Environments.newInstance(Environments.kt:46)
|
15 |
+
kotlinx.dnq.store.container.EntityStoreHelperKt.createTransientEntityStore(EntityStoreHelper.kt:40)
|
16 |
+
kotlinx.dnq.store.container.EntityStoreHelperKt.createTransientEntityStore(EntityStoreHelper.kt:31)
|
17 |
+
kotlinx.dnq.store.container.EntityStoreHelperKt.createTransientEntityStore$default(EntityStoreHelper.kt:30)
|
18 |
+
com.github.copilot.chat.session.persistence.xodus.XdChatSessionPersistenceService.initStore(XdChatSessionPersistenceService.kt:115)
|
19 |
+
com.github.copilot.chat.session.persistence.xodus.XdChatSessionPersistenceService.<init>(XdChatSessionPersistenceService.kt:22)
|
20 |
+
com.github.copilot.chat.session.persistence.xodus.XdChatSessionPersistenceService.<init>(XdChatSessionPersistenceService.kt:15)
|
21 |
+
com.github.copilot.chat.session.persistence.ChatSessionPersistenceServiceKt.ChatSessionPersistenceService(ChatSessionPersistenceService.kt:43)
|
22 |
+
com.github.copilot.chat.session.persistence.ChatSessionPersistenceServiceKt.chatSessionsPersistenceService(ChatSessionPersistenceService.kt:53)
|
23 |
+
com.github.copilot.chat.session.ChatSessionManager.<init>(ChatSessionManager.kt:45)
|
24 |
+
com.github.copilot.chat.session.ChatSessionManager.<init>(ChatSessionManager.kt:25)
|
25 |
+
com.github.copilot.chat.window.CopilotChatToolWindow.onCopilotReady(CopilotChatToolWindow.kt:133)
|
26 |
+
com.github.copilot.chat.window.CopilotChatToolWindow.access$onCopilotReady(CopilotChatToolWindow.kt:40)
|
27 |
+
com.github.copilot.chat.window.CopilotChatToolWindow$initCopilotStatusListener$1.invoke(CopilotChatToolWindow.kt:118)
|
28 |
+
com.github.copilot.chat.window.CopilotChatToolWindow$initCopilotStatusListener$1.invoke(CopilotChatToolWindow.kt:115)
|
29 |
+
com.github.copilot.status.CopilotAuthStatusKt.subscribeToCopilotAuthStatus(CopilotAuthStatus.kt:27)
|
30 |
+
com.github.copilot.chat.window.CopilotChatToolWindow.initCopilotStatusListener(CopilotChatToolWindow.kt:115)
|
31 |
+
com.github.copilot.chat.window.CopilotChatToolWindow.<init>(CopilotChatToolWindow.kt:59)
|
32 |
+
com.github.copilot.chat.window.CopilotChatToolWindow.<init>(CopilotChatToolWindow.kt:40)
|
33 |
+
com.github.copilot.chat.window.CopilotChatToolWindowFactory.init(CopilotChatToolWindowFactory.kt:18)
|
34 |
+
com.intellij.openapi.wm.impl.ToolWindowManagerImpl.registerToolWindow$intellij_platform_ide_impl(ToolWindowManagerImpl.kt:1055)
|
35 |
+
com.intellij.toolWindow.ToolWindowSetInitializerKt.registerToolWindows(ToolWindowSetInitializer.kt:176)
|
36 |
+
com.intellij.toolWindow.ToolWindowSetInitializerKt.access$registerToolWindows(ToolWindowSetInitializer.kt:1)
|
37 |
+
com.intellij.toolWindow.ToolWindowSetInitializer$createAndLayoutToolWindows$entries$1.invokeSuspend(ToolWindowSetInitializer.kt:125)
|
38 |
+
kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
|
39 |
+
kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
|
40 |
+
com.intellij.openapi.application.TransactionGuardImpl$1.run(TransactionGuardImpl.java:194)
|
41 |
+
com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:831)
|
42 |
+
com.intellij.openapi.application.impl.ApplicationImpl$3.run(ApplicationImpl.java:456)
|
43 |
+
com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:79)
|
44 |
+
com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:122)
|
45 |
+
com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:41)
|
46 |
+
java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
|
47 |
+
java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:788)
|
48 |
+
java.desktop/java.awt.EventQueue$3.run(EventQueue.java:739)
|
49 |
+
java.desktop/java.awt.EventQueue$3.run(EventQueue.java:731)
|
50 |
+
java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
|
51 |
+
java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
|
52 |
+
java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:758)
|
53 |
+
com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:666)
|
54 |
+
com.intellij.ide.IdeEventQueue._dispatchEvent$lambda$7(IdeEventQueue.kt:570)
|
55 |
+
com.intellij.openapi.application.impl.ApplicationImpl.withoutImplicitRead(ApplicationImpl.java:1446)
|
56 |
+
com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:570)
|
57 |
+
com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:68)
|
58 |
+
com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:349)
|
59 |
+
com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:348)
|
60 |
+
com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:787)
|
61 |
+
com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:348)
|
62 |
+
com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:343)
|
63 |
+
com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:994)
|
64 |
+
com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:113)
|
65 |
+
com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:994)
|
66 |
+
com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$4(IdeEventQueue.kt:343)
|
67 |
+
com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:831)
|
68 |
+
com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:385)
|
69 |
+
com.intellij.openapi.progress.impl.PlatformTaskSupportKt.pumpEventsForHierarchy(PlatformTaskSupport.kt:341)
|
70 |
+
com.intellij.openapi.progress.impl.PlatformTaskSupportKt.access$pumpEventsForHierarchy(PlatformTaskSupport.kt:1)
|
71 |
+
com.intellij.openapi.progress.impl.PlatformTaskSupport$runBlockingModalInternal$2$1.invoke(PlatformTaskSupport.kt:139)
|
72 |
+
com.intellij.openapi.progress.impl.PlatformTaskSupport$runBlockingModalInternal$2$1.invoke(PlatformTaskSupport.kt:121)
|
73 |
+
com.intellij.openapi.application.impl.ModalityKt.inModalContext(modality.kt:36)
|
74 |
+
com.intellij.openapi.progress.impl.PlatformTaskSupport.runBlockingModalInternal(PlatformTaskSupport.kt:121)
|
75 |
+
com.intellij.openapi.progress.impl.PlatformTaskSupport.access$runBlockingModalInternal(PlatformTaskSupport.kt:41)
|
76 |
+
com.intellij.openapi.progress.impl.PlatformTaskSupport$runBlockingModalInternal$1.invoke(PlatformTaskSupport.kt:113)
|
77 |
+
com.intellij.openapi.progress.impl.PlatformTaskSupport$runBlockingModalInternal$1.invoke(PlatformTaskSupport.kt:110)
|
78 |
+
com.intellij.openapi.progress.CancellationKt$ensureCurrentJob$1.invoke(cancellation.kt:68)
|
79 |
+
com.intellij.openapi.progress.CancellationKt.withCurrentJob$lambda$0(cancellation.kt:17)
|
80 |
+
com.intellij.openapi.progress.Cancellation.withCurrentJob(Cancellation.java:60)
|
81 |
+
com.intellij.openapi.progress.CancellationKt.withCurrentJob(cancellation.kt:17)
|
82 |
+
com.intellij.openapi.progress.CancellationKt.executeWithJobAndCompleteIt(cancellation.kt:126)
|
83 |
+
com.intellij.openapi.progress.CancellationKt.ensureCurrentJob(cancellation.kt:67)
|
84 |
+
com.intellij.openapi.progress.CancellationKt.ensureCurrentJobAllowingOrphan(cancellation.kt:51)
|
85 |
+
com.intellij.openapi.progress.impl.PlatformTaskSupport.runBlockingModalInternal(PlatformTaskSupport.kt:110)
|
86 |
+
com.intellij.openapi.progress.TasksKt.runBlockingModalWithRawProgressReporter(tasks.kt:263)
|
87 |
+
com.intellij.ide.impl.ProjectUtilKt.runBlockingUnderModalProgress(ProjectUtil.kt:731)
|
88 |
+
com.intellij.ide.impl.ProjectUtilKt.runBlockingUnderModalProgress$default(ProjectUtil.kt:726)
|
89 |
+
com.intellij.ide.impl.ProjectUtilKt.runUnderModalProgressIfIsEdt(ProjectUtil.kt:718)
|
90 |
+
com.intellij.openapi.project.impl.ProjectManagerImpl.openProject(ProjectManagerImpl.kt:521)
|
91 |
+
com.intellij.platform.PlatformProjectOpenProcessor$Companion.doOpenProject(PlatformProjectOpenProcessor.kt:173)
|
92 |
+
com.intellij.ide.util.projectWizard.AbstractNewProjectStep.doGenerateProject(AbstractNewProjectStep.java:241)
|
93 |
+
com.intellij.ide.util.projectWizard.AbstractNewProjectStep.doGenerateProject(AbstractNewProjectStep.java:189)
|
94 |
+
com.jetbrains.python.newProject.steps.PythonGenerateProjectCallback.generateProject(PythonGenerateProjectCallback.java:78)
|
95 |
+
com.jetbrains.python.newProject.steps.PythonGenerateProjectCallback.consume(PythonGenerateProjectCallback.java:56)
|
96 |
+
com.intellij.ide.util.projectWizard.ProjectSettingsStepBase$1.actionPerformed(ProjectSettingsStepBase.java:148)
|
97 |
+
java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1972)
|
98 |
+
java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2313)
|
99 |
+
java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405)
|
100 |
+
java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262)
|
101 |
+
java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:279)
|
102 |
+
java.desktop/java.awt.Component.processMouseEvent(Component.java:6656)
|
103 |
+
java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3385)
|
104 |
+
java.desktop/java.awt.Component.processEvent(Component.java:6421)
|
105 |
+
java.desktop/java.awt.Container.processEvent(Container.java:2266)
|
106 |
+
java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5026)
|
107 |
+
java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324)
|
108 |
+
java.desktop/java.awt.Component.dispatchEvent(Component.java:4854)
|
109 |
+
java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4948)
|
110 |
+
java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4575)
|
111 |
+
java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4516)
|
112 |
+
java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2310)
|
113 |
+
java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2804)
|
114 |
+
java.desktop/java.awt.Component.dispatchEvent(Component.java:4854)
|
115 |
+
java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:790)
|
116 |
+
java.desktop/java.awt.EventQueue$3.run(EventQueue.java:739)
|
117 |
+
java.desktop/java.awt.EventQueue$3.run(EventQueue.java:731)
|
118 |
+
java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
|
119 |
+
java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
|
120 |
+
java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97)
|
121 |
+
java.desktop/java.awt.EventQueue$4.run(EventQueue.java:763)
|
122 |
+
java.desktop/java.awt.EventQueue$4.run(EventQueue.java:761)
|
123 |
+
java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
|
124 |
+
java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
|
125 |
+
java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:760)
|
126 |
+
com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:666)
|
127 |
+
com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.kt:614)
|
128 |
+
com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:569)
|
129 |
+
com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:68)
|
130 |
+
com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:349)
|
131 |
+
com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:348)
|
132 |
+
com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:787)
|
133 |
+
com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:348)
|
134 |
+
com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:343)
|
135 |
+
com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:994)
|
136 |
+
com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:105)
|
137 |
+
com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:994)
|
138 |
+
com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$4(IdeEventQueue.kt:343)
|
139 |
+
com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:831)
|
140 |
+
com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:385)
|
141 |
+
java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
|
142 |
+
java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
|
143 |
+
java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:121)
|
144 |
+
java.desktop/java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:191)
|
145 |
+
java.desktop/java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:236)
|
146 |
+
java.desktop/java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:234)
|
147 |
+
java.base/java.security.AccessController.doPrivileged(AccessController.java:318)
|
148 |
+
java.desktop/java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:234)
|
149 |
+
java.desktop/java.awt.Dialog.show(Dialog.java:1080)
|
150 |
+
com.intellij.openapi.ui.impl.DialogWrapperPeerImpl$MyDialog.show(DialogWrapperPeerImpl.java:741)
|
151 |
+
com.intellij.openapi.ui.impl.DialogWrapperPeerImpl.show(DialogWrapperPeerImpl.java:466)
|
152 |
+
com.intellij.openapi.ui.DialogWrapper.doShow(DialogWrapper.java:1675)
|
153 |
+
com.intellij.openapi.ui.DialogWrapper.show(DialogWrapper.java:1633)
|
154 |
+
com.jetbrains.python.newProject.PyCharmNewProjectAction.actionPerformed(PyCharmNewProjectAction.java:13)
|
155 |
+
com.intellij.openapi.actionSystem.ex.ActionUtil.doPerformActionOrShowPopup(ActionUtil.java:333)
|
156 |
+
com.intellij.openapi.actionSystem.ex.ActionUtil.lambda$performActionDumbAwareWithCallbacks$4(ActionUtil.java:307)
|
157 |
+
com.intellij.openapi.actionSystem.ex.ActionUtil.performDumbAwareWithCallbacks(ActionUtil.java:356)
|
158 |
+
com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAwareWithCallbacks(ActionUtil.java:307)
|
159 |
+
com.intellij.openapi.actionSystem.impl.ActionMenuItem.lambda$performAction$5(ActionMenuItem.java:299)
|
160 |
+
com.intellij.openapi.wm.impl.FocusManagerImpl.runOnOwnContext(FocusManagerImpl.java:225)
|
161 |
+
com.intellij.openapi.actionSystem.impl.ActionMenuItem.performAction(ActionMenuItem.java:292)
|
162 |
+
com.intellij.openapi.actionSystem.impl.ActionMenuItem.lambda$new$1(ActionMenuItem.java:81)
|
163 |
+
com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:113)
|
164 |
+
com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:94)
|
165 |
+
com.intellij.openapi.actionSystem.impl.ActionMenuItem.lambda$new$2(ActionMenuItem.java:81)
|
166 |
+
java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
|
167 |
+
java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:788)
|
168 |
+
java.desktop/java.awt.EventQueue$3.run(EventQueue.java:739)
|
169 |
+
java.desktop/java.awt.EventQueue$3.run(EventQueue.java:731)
|
170 |
+
java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
|
171 |
+
java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
|
172 |
+
java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:758)
|
173 |
+
com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:666)
|
174 |
+
com.intellij.ide.IdeEventQueue._dispatchEvent$lambda$7(IdeEventQueue.kt:570)
|
175 |
+
com.intellij.openapi.application.impl.ApplicationImpl.withoutImplicitRead(ApplicationImpl.java:1446)
|
176 |
+
com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:570)
|
177 |
+
com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:68)
|
178 |
+
com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:349)
|
179 |
+
com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:348)
|
180 |
+
com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:787)
|
181 |
+
com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:348)
|
182 |
+
com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:343)
|
183 |
+
com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:994)
|
184 |
+
com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:105)
|
185 |
+
com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:994)
|
186 |
+
com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$4(IdeEventQueue.kt:343)
|
187 |
+
com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:831)
|
188 |
+
com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:385)
|
189 |
+
java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
|
190 |
+
java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
|
191 |
+
java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
|
192 |
+
java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
|
193 |
+
java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
|
194 |
+
java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)
|
.idea/inspectionProfiles/Project_Default.xml
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<component name="InspectionProjectProfileManager">
|
2 |
+
<profile version="1.0">
|
3 |
+
<option name="myName" value="Project Default" />
|
4 |
+
<inspection_tool class="PyPackageRequirementsInspection" enabled="true" level="WARNING" enabled_by_default="true">
|
5 |
+
<option name="ignoredPackages">
|
6 |
+
<value>
|
7 |
+
<list size="11">
|
8 |
+
<item index="0" class="java.lang.String" itemvalue="Flask-Caching" />
|
9 |
+
<item index="1" class="java.lang.String" itemvalue="fiona" />
|
10 |
+
<item index="2" class="java.lang.String" itemvalue="geopandas" />
|
11 |
+
<item index="3" class="java.lang.String" itemvalue="basemap" />
|
12 |
+
<item index="4" class="java.lang.String" itemvalue="gdal" />
|
13 |
+
<item index="5" class="java.lang.String" itemvalue="datashader" />
|
14 |
+
<item index="6" class="java.lang.String" itemvalue="statsmodels" />
|
15 |
+
<item index="7" class="java.lang.String" itemvalue="dask" />
|
16 |
+
<item index="8" class="java.lang.String" itemvalue="dash" />
|
17 |
+
<item index="9" class="java.lang.String" itemvalue="dash-bootstrap-components" />
|
18 |
+
<item index="10" class="java.lang.String" itemvalue="imbalanced-learn" />
|
19 |
+
</list>
|
20 |
+
</value>
|
21 |
+
</option>
|
22 |
+
</inspection_tool>
|
23 |
+
</profile>
|
24 |
+
</component>
|
.idea/inspectionProfiles/profiles_settings.xml
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<component name="InspectionProjectProfileManager">
|
2 |
+
<settings>
|
3 |
+
<option name="USE_PROJECT_PROFILE" value="false" />
|
4 |
+
<version value="1.0" />
|
5 |
+
</settings>
|
6 |
+
</component>
|
.idea/misc.xml
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<project version="4">
|
3 |
+
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.10 (Segment_things)" project-jdk-type="Python SDK" />
|
4 |
+
</project>
|
.idea/modules.xml
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<project version="4">
|
3 |
+
<component name="ProjectModuleManager">
|
4 |
+
<modules>
|
5 |
+
<module fileurl="file://$PROJECT_DIR$/.idea/Segment_things.iml" filepath="$PROJECT_DIR$/.idea/Segment_things.iml" />
|
6 |
+
</modules>
|
7 |
+
</component>
|
8 |
+
</project>
|
.idea/vcs.xml
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<project version="4">
|
3 |
+
<component name="VcsDirectoryMappings">
|
4 |
+
<mapping directory="" vcs="Git" />
|
5 |
+
</component>
|
6 |
+
</project>
|
semantic-segmentation/SemanticModel/prediction.py
CHANGED
@@ -112,91 +112,195 @@ class PredictionPipeline:
|
|
112 |
print(f'\nPredictions saved to: {output_dir}')
|
113 |
return output_dir
|
114 |
|
115 |
-
def predict_raster(
|
116 |
-
|
117 |
-
|
118 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
119 |
with rio.open(raster_path) as src:
|
|
|
120 |
raster = src.read()
|
121 |
-
raster = np.moveaxis(raster, 0, 2)
|
|
|
122 |
profile = src.profile
|
123 |
transform = src.transform
|
124 |
-
|
|
|
125 |
if boundary_path:
|
126 |
boundary = gpd.read_file(boundary_path)
|
127 |
boundary = boundary.to_crs(profile['crs'])
|
128 |
boundary_geom = boundary.iloc[0].geometry
|
129 |
-
|
|
|
130 |
tiles = slidingwindow.generate(
|
131 |
raster,
|
132 |
slidingwindow.DimOrder.HeightWidthChannel,
|
133 |
tile_size,
|
134 |
overlap
|
135 |
)
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
|
|
|
|
|
|
|
|
140 |
aug = get_validation_augmentations(tile_size, tile_size, fixed_size=False)
|
141 |
-
|
|
|
|
|
|
|
142 |
for idx, tile in enumerate(tiles):
|
143 |
if (idx + 1) % 10 == 0 or idx == len(tiles) - 1:
|
144 |
-
print(f
|
145 |
-
|
|
|
146 |
bounds = tile.indices()
|
147 |
-
|
|
|
148 |
tile_image = raster[bounds[0], bounds[1]]
|
149 |
-
|
150 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
151 |
corners = [
|
152 |
convert_coordinates(transform, bounds[1].start, bounds[0].start),
|
153 |
convert_coordinates(transform, bounds[1].stop, bounds[0].start),
|
154 |
convert_coordinates(transform, bounds[1].stop, bounds[0].stop),
|
155 |
convert_coordinates(transform, bounds[1].start, bounds[0].stop)
|
156 |
]
|
157 |
-
|
|
|
|
|
158 |
continue
|
159 |
-
|
|
|
160 |
processed = aug(image=tile_image)['image']
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
161 |
processed = self.config.preprocessing(image=processed)['image']
|
162 |
-
|
163 |
x_tensor = torch.from_numpy(processed).to(self.device).unsqueeze(0)
|
|
|
|
|
|
|
164 |
with torch.no_grad():
|
|
|
165 |
prediction = self.model.predict(x_tensor)
|
|
|
166 |
prediction = prediction.squeeze().cpu().numpy()
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
171 |
else:
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
tile_pred =
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
182 |
existing_conf = confidence[bounds[0], bounds[1]]
|
183 |
existing_pred = pred_raster[bounds[0], bounds[1]]
|
184 |
-
|
185 |
-
mask =
|
186 |
existing_pred[mask] = tile_pred[mask]
|
187 |
existing_conf[mask] = tile_conf[mask]
|
188 |
-
|
189 |
pred_raster[bounds[0], bounds[1]] = existing_pred
|
190 |
confidence[bounds[0], bounds[1]] = existing_conf
|
191 |
-
|
|
|
|
|
|
|
|
|
192 |
pred_raster = self._format_prediction(pred_raster, format)
|
193 |
-
|
|
|
194 |
if output_path or boundary_path:
|
195 |
self._save_raster_prediction(
|
196 |
-
pred_raster,
|
197 |
-
|
|
|
|
|
|
|
198 |
)
|
199 |
-
|
200 |
return pred_raster, profile
|
201 |
|
202 |
def _format_prediction(self, prediction, format):
|
|
|
112 |
print(f'\nPredictions saved to: {output_dir}')
|
113 |
return output_dir
|
114 |
|
115 |
+
def predict_raster(
|
116 |
+
self,
|
117 |
+
raster_path,
|
118 |
+
tile_size=1024,
|
119 |
+
overlap=0.175,
|
120 |
+
boundary_path=None,
|
121 |
+
output_path=None,
|
122 |
+
format='integer'
|
123 |
+
):
|
124 |
+
"""
|
125 |
+
Processes large raster images using a tiling approach. For each tile:
|
126 |
+
1) Optionally checks a boundary mask (if provided) to skip tiles outside an ROI.
|
127 |
+
2) Applies augmentations/preprocessing, then runs the model prediction.
|
128 |
+
3) Resizes back to the tile's original size if necessary (e.g., after aug).
|
129 |
+
4) Merges the tile predictions into a final 'pred_raster' (with confidence blending).
|
130 |
+
|
131 |
+
Args:
|
132 |
+
raster_path (str): Path to the large raster image (GeoTIFF).
|
133 |
+
tile_size (int): Dimensions of each tile (default 1024).
|
134 |
+
overlap (float): Overlap fraction between tiles (default 0.175).
|
135 |
+
boundary_path (str): Path to shapefile/geojson for boundary region (optional).
|
136 |
+
output_path (str): Path to save prediction (optional).
|
137 |
+
format (str): 'integer' for integer mask, 'color' for RGB, etc.
|
138 |
+
|
139 |
+
Returns:
|
140 |
+
pred_raster (np.ndarray): 2D or 3D numpy array with the final merged prediction.
|
141 |
+
profile (dict): Raster profile/metadata for georeferencing or saving.
|
142 |
+
"""
|
143 |
+
|
144 |
+
print("Loading raster...")
|
145 |
with rio.open(raster_path) as src:
|
146 |
+
# Read [Bands, Height, Width] -> Move axis => [Height, Width, Bands]
|
147 |
raster = src.read()
|
148 |
+
raster = np.moveaxis(raster, 0, 2)
|
149 |
+
raster = raster[:, :, :3] # keep only first 3 bands if >3
|
150 |
profile = src.profile
|
151 |
transform = src.transform
|
152 |
+
|
153 |
+
boundary_geom = None
|
154 |
if boundary_path:
|
155 |
boundary = gpd.read_file(boundary_path)
|
156 |
boundary = boundary.to_crs(profile['crs'])
|
157 |
boundary_geom = boundary.iloc[0].geometry
|
158 |
+
|
159 |
+
print("Generating tiles...")
|
160 |
tiles = slidingwindow.generate(
|
161 |
raster,
|
162 |
slidingwindow.DimOrder.HeightWidthChannel,
|
163 |
tile_size,
|
164 |
overlap
|
165 |
)
|
166 |
+
|
167 |
+
# Prepare the output arrays:
|
168 |
+
# pred_raster => final integer (or color) predictions
|
169 |
+
# confidence => track confidence per pixel to do max merging
|
170 |
+
pred_raster = np.zeros_like(raster[:, :, 0], dtype='uint8') # shape: (H, W)
|
171 |
+
confidence = np.zeros_like(pred_raster, dtype=np.float32) # shape: (H, W)
|
172 |
+
|
173 |
+
# Get your augmentations/preprocessing
|
174 |
aug = get_validation_augmentations(tile_size, tile_size, fixed_size=False)
|
175 |
+
|
176 |
+
# -------------------------------
|
177 |
+
# Iterate over each tile
|
178 |
+
# -------------------------------
|
179 |
for idx, tile in enumerate(tiles):
|
180 |
if (idx + 1) % 10 == 0 or idx == len(tiles) - 1:
|
181 |
+
print(f"\rProcessed {idx + 1}/{len(tiles)} tiles", end="")
|
182 |
+
|
183 |
+
# tile.indices() = (slice(row_start, row_end), slice(col_start, col_end))
|
184 |
bounds = tile.indices()
|
185 |
+
|
186 |
+
# Extract tile from the big raster
|
187 |
tile_image = raster[bounds[0], bounds[1]]
|
188 |
+
# tile_image.shape => (tile_height, tile_width, channels)
|
189 |
+
|
190 |
+
# print(f"\n[DEBUG] Tile #{idx}: tile_image shape before aug = {tile_image.shape}")
|
191 |
+
|
192 |
+
# 1) Check for zero-size tile BEFORE augmentations
|
193 |
+
if tile_image.shape[0] == 0 or tile_image.shape[1] == 0:
|
194 |
+
# print("[DEBUG] Skipping tile => zero dimension BEFORE aug")
|
195 |
+
continue
|
196 |
+
|
197 |
+
# 2) If boundary is given, skip tile if it doesn't intersect
|
198 |
+
if boundary_geom is not None:
|
199 |
corners = [
|
200 |
convert_coordinates(transform, bounds[1].start, bounds[0].start),
|
201 |
convert_coordinates(transform, bounds[1].stop, bounds[0].start),
|
202 |
convert_coordinates(transform, bounds[1].stop, bounds[0].stop),
|
203 |
convert_coordinates(transform, bounds[1].start, bounds[0].stop)
|
204 |
]
|
205 |
+
poly = Polygon(corners)
|
206 |
+
if not poly.intersects(boundary_geom):
|
207 |
+
# print("[DEBUG] Skipping tile => outside boundary")
|
208 |
continue
|
209 |
+
|
210 |
+
# 3) Apply augmentations
|
211 |
processed = aug(image=tile_image)['image']
|
212 |
+
# print(f"[DEBUG] processed shape after aug = {processed.shape}")
|
213 |
+
|
214 |
+
# Check for zero-size tile AFTER augmentations
|
215 |
+
if processed.shape[0] == 0 or processed.shape[1] == 0:
|
216 |
+
# print("[DEBUG] Skipping tile => zero dimension AFTER aug")
|
217 |
+
continue
|
218 |
+
|
219 |
+
# 4) Preprocessing for the model
|
220 |
processed = self.config.preprocessing(image=processed)['image']
|
|
|
221 |
x_tensor = torch.from_numpy(processed).to(self.device).unsqueeze(0)
|
222 |
+
|
223 |
+
# right after model inference and before merging into pred_raster ...
|
224 |
+
|
225 |
with torch.no_grad():
|
226 |
+
# Model output: shape ~ (1, n_classes, H_aug, W_aug)
|
227 |
prediction = self.model.predict(x_tensor)
|
228 |
+
# Remove batch dimension: (n_classes, H_aug, W_aug) for multi-class
|
229 |
prediction = prediction.squeeze().cpu().numpy()
|
230 |
+
|
231 |
+
# -----------------------------------------------------------------
|
232 |
+
# 1) Convert raw logits -> label map (tile_pred) and confidence map
|
233 |
+
# -----------------------------------------------------------------
|
234 |
+
# If you have 'n_classes=4', `prediction.shape` might be (4, H_aug, W_aug).
|
235 |
+
# We must ARGMAX across the class dimension to get a 2D label map.
|
236 |
+
# In predict_raster() function, replace this part:
|
237 |
+
|
238 |
+
if prediction.ndim == 3 and prediction.shape[0] == self.config.n_classes:
|
239 |
+
# Multi-class case
|
240 |
+
tile_pred = np.argmax(prediction, axis=0).astype(np.uint8)
|
241 |
+
tile_conf = np.max(prediction, axis=0).astype(np.float32)
|
242 |
else:
|
243 |
+
# Binary case - take first channel if multiple channels
|
244 |
+
if prediction.ndim == 3:
|
245 |
+
prediction = prediction[0] # Take first channel
|
246 |
+
tile_conf = np.abs(prediction - 0.5).astype(np.float32)
|
247 |
+
tile_pred = np.round(prediction).astype(np.uint8)
|
248 |
+
|
249 |
+
orig_hw = tile_image.shape[:2] # (tile_height, tile_width)
|
250 |
+
if tile_pred.shape != orig_hw:
|
251 |
+
# print(f"[DEBUG] Resizing from {tile_pred.shape} to {orig_hw} ...")
|
252 |
+
|
253 |
+
# Cast to float32 for cv2.resize
|
254 |
+
tile_pred_float = tile_pred.astype(np.float32)
|
255 |
+
tile_conf_float = tile_conf.astype(np.float32)
|
256 |
+
|
257 |
+
# cv2 expects (width, height)
|
258 |
+
cv2_size = (orig_hw[1], orig_hw[0])
|
259 |
+
if cv2_size[0] == 0 or cv2_size[1] == 0:
|
260 |
+
# print("[DEBUG] Skipping tile => zero dimension for cv2_size!")
|
261 |
+
continue
|
262 |
+
|
263 |
+
# NEAREST for label map, LINEAR for confidence
|
264 |
+
tile_pred_resized = cv2.resize(
|
265 |
+
tile_pred_float, cv2_size, interpolation=cv2.INTER_NEAREST
|
266 |
+
)
|
267 |
+
tile_conf_resized = cv2.resize(
|
268 |
+
tile_conf_float, cv2_size, interpolation=cv2.INTER_LINEAR
|
269 |
+
)
|
270 |
+
|
271 |
+
# Convert back to appropriate dtypes
|
272 |
+
tile_pred = np.round(tile_pred_resized).astype(np.uint8)
|
273 |
+
tile_conf = tile_conf_resized.astype(np.float32)
|
274 |
+
|
275 |
+
# -----------------------------------------------------------------
|
276 |
+
# 3) Merge tile_pred into the final pred_raster / confidence arrays
|
277 |
+
# -----------------------------------------------------------------
|
278 |
existing_conf = confidence[bounds[0], bounds[1]]
|
279 |
existing_pred = pred_raster[bounds[0], bounds[1]]
|
280 |
+
|
281 |
+
mask = tile_conf > existing_conf
|
282 |
existing_pred[mask] = tile_pred[mask]
|
283 |
existing_conf[mask] = tile_conf[mask]
|
284 |
+
|
285 |
pred_raster[bounds[0], bounds[1]] = existing_pred
|
286 |
confidence[bounds[0], bounds[1]] = existing_conf
|
287 |
+
|
288 |
+
|
289 |
+
print("\n Finished all tiles")
|
290 |
+
|
291 |
+
# 9) Convert pred_raster to final format (color or integer)
|
292 |
pred_raster = self._format_prediction(pred_raster, format)
|
293 |
+
|
294 |
+
# 10) (Optional) Save if output_path or boundary_path provided
|
295 |
if output_path or boundary_path:
|
296 |
self._save_raster_prediction(
|
297 |
+
pred_raster,
|
298 |
+
raster_path,
|
299 |
+
output_path,
|
300 |
+
profile,
|
301 |
+
boundary_geom if boundary_path else None
|
302 |
)
|
303 |
+
|
304 |
return pred_raster, profile
|
305 |
|
306 |
def _format_prediction(self, prediction, format):
|